javascript - Trigger keypress on button click -
$(document).keypress(function(event) { // + if (event.which == 43) { // ... } }
html
<input type="button" value="+" name="plus">
how can trigger keypress method + when clicking button?
$('input[name="plus"]').click(function(){ // ??? how go further ??? })
here go
var e = jquery.event("keypress"); e.which = 43; // # key code value $(document).trigger(e);
Comments
Post a Comment