- Obtener enlace
- X
- Correo electrónico
- Otras aplicaciones
// Disable change of values by pressing the cursor keys $ ( 'input[type="number"]' ). bind ( 'keypress' , function ( event ) { if ( event ) { if ( event . keyCode == 38 || event . keyCode == 40 ) { // arrow keys return false ; } } }); // disable mousewheel on a input number field when in focus // (to prevent Cromium browsers change the value when scrolling) $ ( 'html' ). on ( 'focus' , 'input[type=number]' , function ( e ) { $ ( this ). on ( 'mousewheel.disableScroll' , function ( e ) { e . preventDefault (); }); }); $ ( 'html' ). on ( 'blur' , 'input[type=number]' , function ( e ) { $ ( this ). off ( 'mousewheel.disableScroll' ); });