$(document).keypress(function(event) {
// +
if (event.which == 43) {
// ...
}
}
HTML
<input type="button" value="+" name="plus">
How can I trigger the keypress method with + when clicking the button?
$('input[name="plus"]').click(function(){
// ??? How to go further ???
})
Here you go
var e = jQuery.Event("keypress");
e.which = 43; // # Some key code value
$(document).trigger(e);