我有以下html5输入元素:
<input type="number">
为什么此输入允许在输入字段中输入字符“e”?不能输入其他字母字符(如预期)
使用chrome v。44.0.2403.107
看看我的意思:http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_number
解决方法
因为这正是07000说它应该工作。数字输入可以接受
floating point numbers,包括负号和e或E字符:
A floating-point number consists of the following parts,in exactly
the following order:
- Optionally,the first character may be a “
-” character.- One or more characters in the range “
0—9“.- Optionally,the following parts,in exactly the following order:
- a “
.” character- one or more characters in the range “
0—9“- Optionally,in exactly the following order:
- a “
e” character or “E” character- optionally,a “
-” character or “+” character- One or more characters in the range “
0—9“.