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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -