javascript - Call keypress event on button click? -
i have below jquery code execute on keypress execute same on button click. please me.
$('#itemselected').live('keypress', function() { //some code using $(this) also. }
var myfunction = function(event){ console.debug(event); //do stuff here }; $('#itemselected').on('keypress', function(event) { myfunction(event); } $('#itemselected').on('click', function(event) { myfunction(event); }
Comments
Post a Comment