Answers for "Function that replaces character and allow only numbers into the textbox"

0

Function that replaces character and allow only numbers into the textbox

This  technique we can use on the onkeyup property of HTML element

<input type="text" id="txtMobileNo"  
onkeyup="if (/\D/g.test(this.value)) this.value = this.value.replace(/\D/g,'')"
Posted by: Guest on May-07-2020

Code answers related to "Function that replaces character and allow only numbers into the textbox"

Browse Popular Code Answers by Language