jQuery

Allow Number only in Input Text using jQuery

$(document).ready(function() {
    $("input[type=text]").keypress(function (e) {
        if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
           alert('Only number are allowed')
            return false;
        }
    });
});

Get The latest Coding solutions.

Subscribe to the Email Newsletter