Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

HTML text input allow only numeric input

<input type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(..*?)..*/g, '$1').replace(/^0[^.]/, '0');" />
 Run code snippetHide results
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #HTML #text #input #numeric #input
ADD COMMENT
Topic
Name
7+7 =