Is there a float input type in HTML5?

前端 未结 9 1920
失恋的感觉
失恋的感觉 2020-11-22 11:32

According to html5.org, the \"number\" input type\'s \"value attribute, if specified and not empty, must have a value that is a valid floating point number.\"

Yet it

9条回答
  •  [愿得一人]
    2020-11-22 12:24

    I just had the same problem, and I could fix it by just putting a comma and not a period/full stop in the number because of French localization.

    So it works with:

    2 is OK

    2,5 is OK

    2.5 is KO (The number is considered "illegal" and you receive empty value).

提交回复
热议问题