<script language="javascript" type="text/javascript">
function getNum(text){
var value = /\d+/.exec(text);
//var value = text.replace(/^[0-9]/,"");
alert(value);
}
</script>
<input type="text" id="btn_getNum"/>
<input type="button" value="得到数字" onclick="getNum(btn_getNum.value);"/>
时间: 2024-10-14 12:44:48