🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

numeric.js is an easy-to-use jQuery plugin which permits only numeric values being entered into an input field. Supports both positive and negative values.

input

Documentation

jquery.numeric

Restrict input fields to numeric input, and a generic jQuery valueAsNumber

Sample usage:

$('input[type=text]').numeric({ negative: true, decimal: false }) 

To fetch a value of type Number, call valueAsNumber(). (This works on input[type=number] also.)

I.e.

$('#my-input').valueAsNumber() 

You May Also Like