I have dynamic elements with a dropdown menu on each. The dropdown contains unique links, Upon clicking an option button, a dropdown menu appears, based on the element you clicked.
Now I want to hide previously clicked dropdown menu if the user clicks on another dropdown button.
How can I get this done, I have tried a few things based on my knowledge example of what I have down below.
/* TOGGLE DROPDOWN ON CLICK */
$(document).on("click", "#dropdown-toggle", function (event) {
event.stopPropagation();
$(this).siblings().toggleClass('show')
});