发布网友 发布时间:2024-10-01 20:45
共1个回答
热心网友 时间:2024-12-04 07:23
script language="javascript">function validText(ot){var validstr=ot.getAttribute("valid");var Correntkey=String.fromCharCode(event.keyCode); return(validstr.indexOf(Correntkey)>-1)? false:true; } </script></head><body><input type="text" id="t" valid="ABC" onkeydown="return validText(this)"/></body>