Answers for "event.which"

2

jquery event keycode

$('#someTextBox').keypress(function(event){
    var keycode = (event.keyCode ? event.keyCode : event.which);
    if(keycode == '13'){
        alert('You pressed a "enter" key in textbox');  
    }
});
Posted by: Guest on May-10-2020
0

event.which

var x = event.which || event.keyCode;  // Use either which or keyCode,  depending on browser support
Posted by: Guest on March-17-2021

Browse Popular Code Answers by Language