Answers for "numeric only input attribute"

0

type numeric value only in textbox javascript

function isNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
        return false;
    }
    return true;
}
Posted by: Guest on January-22-2021
0

input digits only

<input type="text" 
       onkeyup="this.value=this.value.replace(/[^d]/,'')">
Posted by: Guest on October-04-2021

Browse Popular Code Answers by Language