I can trigger click event on element selector
using trigger
$('element selector').trigger('click')
Is it possible to trigger shift click. I mean shift + left mouse click.
try
var shiftClick = jQuery.Event("click");
shiftClick.shiftKey = true;
$("element selector").click(function(event) {
if (event.shiftKey) {
alert("Shift key is pressed");
}
else {
alert('No shift hey');
}
});
$("element selector").trigger(shiftClick);
JSFiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With