HTML5 number field issue

February 28th, 2011

When the HTML5 standard was announce we were excited to start implementing it in our latest project. Local Storage and typed fields were two of the additions that are highlighted in our most recent project. When we started using the HTML5 number field we noticed that if the cursor would go over a number field when using the mouse wheel to scroll the page, it would change the value inside the number field.
To prevent this default behaviour with jQuery, you can use the following:
$('input[type=number]').live('mousewheel', function(event) {
    event.preventDefault();
});


Leave a Reply