DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
How to make HTML input tag only accept numerical values? in jsx
<input onKeyPress={(event) => { if (!/[0-9]/.test(event.key)) { event.preventDefault(); } }} />
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#How
#HTML
#input
#tag
#accept
#numerical
#jsx
ADD COMMENT
Topic
COMMENT
Name
6+9 =
Submit