日期:2014-05-16 浏览次数:20305 次
1. js(文本框只允许输入数字)
<form>
????<input type="text" name="money" onkeypress="checkNum(this)">
</form>
<script language="javascript" type="text/javascript">
????function checkNum()
????{
????????if(window.event.keyCode > '9'.charCodeAt(0) ||
???????????window.event.keyCode < '0'.charCodeAt(0))
????????{
????????????window.event.returnValue=false;
????????}
????}
</script>
2.
js(ip地址输入)
?
<html>