Dica: Input numérico com jQuery

Adicione a referência do jQuery, adicione o script e adicone a classe .num ao input que deseja que aceite somente números

$(‘.num’).bind(‘keypress’, function(e) {
return (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) ? false : true;
})

This entry was posted in Home and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>