Check if Event was Triggered or Native

0
0
$('button').click(function(event, wasTriggered) {
    if (wasTriggered) {
        alert('triggered in code');
    } else {
        alert('triggered by mouse');
    }
});

$('button').trigger('click', true);
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.