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); 

src: definitive way trigger keypress events jquery


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -