html5 – 为什么类型为“number”的html输入允许在字段中输入字母“e”?

我有以下html5输入元素:
<input type="number">

为什么此输入允许在输入字段中输入字符“e”?不能输入其他字母字符(如预期)

使用chrome v。44.0.2403.107

看看我的意思:http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_number

解决方法

因为这正是070​​00说它应该工作。数字输入可以接受 floating point numbers包括负号和e或E字符:

A floating-point number consists of the following parts,in exactly
the following order:

  1. Optionally,the first character may be a “-” character.
  2. One or more characters in the range “0—9“.
  3. Optionally,the following parts,in exactly the following order:
    1. a “.” character
    2. one or more characters in the range “0—9
  4. Optionally,in exactly the following order:
    1. a “e” character or “E” character
    2. optionally,a “-” character or “+” character
    3. One or more characters in the range “0—9“.

相关文章

HTML5和CSS3实现3D展示商品信息的代码
利用HTML5中的Canvas绘制笑脸的代码
Html5剪切板功能的实现
如何通过HTML5触摸事件实现移动端简易进度条
Html5移动端获奖无缝滚动动画实现
关于HTML5和CSS3实现机器猫的代码