Why jQuery cannot trigger native click on an anchor tag?

there is no event handler attached using jQuery’s event system that corresponds to these events

This means, at this point of the learning material, no jQuery event handlers has been attached to these elements using .click(function() {} or .bind('click', function () {}), etc.

The no-argument .click() is used to trigger (.trigger('click')) a “click” event from jQuery’s perspective, which will execute all “click” event handlers registered by jQuery using .click, .bind, .on, etc. This pseudo event won’t be sent to the browser.

.trigger()

Execute all handlers and behaviors attached to the matched elements for the given event type.

Check the updated jsFiddle example, click on the two links to see the difference. Hope it helps.

Leave a Comment