1

This is the jQuery code:

$(document).on('click', function (e) {
    alert();
});

The problem that when I click on some elements like the bootstrap dropdown menu or chosen.js or bootstrap_sellect.js the alert doesn't display.

As I understand these scripts prevent this but how can pass this and getting an alert when I click on anything on my page?

Kiran
  • 20,167
  • 11
  • 67
  • 99
John
  • 171
  • 10

1 Answers1

1

You can manually unbind all bootstrap events from dropdown menus, with namespaced events in jquery:

$(document).on('click', function (e) {
    alert();
});
$('.dropdown-toggle').off('.bs');
Coli
  • 927
  • 8
  • 28