trigger button with enter key
Page 1 of 1
trigger button with enter key
How do you code the script to be run when the user presses the enter key on the keyboard?Re: trigger button with enter key
I found this...should've searched better before asking.I already have JQuery code written to run when the button is pressed using this:
$('#button_id').click(function() {
button code
});
So in the js file I put in the following separately (inside document ready):
$('#button_id').keyup(function(e) {
if(e.keyCode == 13){
button code
}
});
Re: trigger button with enter key
i agree with gmath you should Google before asking its very easy and have billion of tutorials on net how to do this by searching on Google you will fins your solution instantly rather then waiting peoples to answer for your question.Page 1 of 1