qq_感受時(shí)光的匆匆流失_0
2017-06-10 23:19:52
<html>
<body>
<script?type="text/javascript">
function?noNumbers(e)
{
var?keynum
var?keychar
var?numcheck
if(window.event)?//?IE
?{
?keynum?=?e.keyCode
?}
else?if(e.which)?//?Netscape/Firefox/Opera
?{
?keynum?=?e.which
?}
keychar?=?String.fromCharCode(keynum)
numcheck?=?/\d/
return?!numcheck.test(keychar)
}
</script>
<form>
Type?some?text?(numbers?not?allowed):
<input?type="text"?onkeypress="return?noNumbers(event)"?/>
</form>
</html>
3 回答

添加回答
舉報(bào)
0/150
提交
取消