How to close the div popup/any Element while clicking outside of the popup
JQUERY
$(document).mouseup(function(e)
{
var container = $(“#divPatientDetail”);
if (container.has(e.target).length === 0)
{
container.hide();
}
});
Explanation:
var container = $(“#divPatientDetail”); — Assigning the selector to the variable
container.hide(); — After checking the condition , it hide the selector element
Note :
It will not hide while clicking inside of the div/Element
Thanks bunny…
this code helped me a lot. Thank a lot buddy. I’m feeling very happy
It is not working. Actually while clicking the element the popup no more appears