I am working with DataTable and TableTools plugins with jQuery.
I am trying to simulate a keyPress (or keyUp), when someone clicks a link in the page.
html code :
<a href='#' id='return'>رجوع</a>
jQuery code :
$('#return').click(function() {
e.preventDefault();
$(this).trigger(// code here // );
});
I can't find the code to put there.
Try this
$(this).trigger('keyup');
Update
Try this :
$('#return').click(function(evt) {
e.preventDefault();
var evt = jQuery.Event('keyup');
evt.keyCode = 27;
evt.which = 27;
$(this).trigger(evt);
alert(evt.keyCode);
});