Answers for "only accept numbers in input javascript"

0

html javascript input numbers only

<input type="text" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*?)\..*/g, '$1');" />
Posted by: Guest on March-24-2022
1

input only accept numbers

<label for="salary">Enter your salary:</label>
<input type="text" id="salary" name="salary"
    oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');" />
Posted by: Guest on December-10-2021

Code answers related to "only accept numbers in input javascript"

Browse Popular Code Answers by Language