Non-numeric input is prohibited, but Sogou Input can still enter the letter e in Chinese.

< input type="number" onkeypress="return (/ [d] / .test (String.fromCharCode (event.keyCode)"/ >
this expression can still enter the letter e in Chrome browser and Sogou Input Chinese input state. The letter e may have a special value in mathematics. How to disable the input of e?

Mar.12,2021

[0,9] numbers
[0,9\.] Decimal
[0,9\.\ -] Decimal negative


The

keypress event is not compatible and it is not recommended to listen to this event.
clipboard.png

you can listen to the input event, and then use the rule to determine whether the string is legal:

  https://codepen.io/CodingMonk.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea5562-1d48.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea5562-1d48.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?