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.
如果在javascript中有数字,我如何检查提示框中的输入?
var name=prompt("enter your name");
在这种情况下,我的名字不应该有数字我该如何检查这种情况???
var name = prompt(...) || ''; if (name.match(/\d/)) alert("you can't use numbers in your name");