I have a toggle div and a button, when i clicking button show/hide toggle button.
I use this code for, when clicking anywhere of the page hide the toggle div.
$(document).click(function () {
var $el = $(".Search");
// toggle div
if ($el.is(":visible")) {
// fade out
$(".Search").toggle("slow");
}
});
My problem is: When clicking on control in toggle button , this function run and hide toggle div.
I want to get id of a clicked control. if control is toggle div don't run this function.