Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个无法按 Java Script 中的字母键并删除输入的字符的文本框。
只需将此属性添加到您的输入中:
onkeydown = "if(/[a-z]/i.test(String.fromCharCode((event||window.event).keyCode))){return false;}"