I'm creating a basic dropdown menu with twitter bootstrap. When I click on the button that opens the dropdown menu, everything works fine.
The problem is, when I try to toggle dropdown by clicking some other element on the page (I need this functionality)
$(document).on("click", ".drop-toggle", function(e) {
console.log("working");
$(".btn-group").toggleClass("open");
});
I can see console message, but nothing happens.
When I simply call
$(".btn-group").toggleClass("open");
it works, but it doesn't work from the event handler. Any ideas why?