Ok, here the jQuery based solution is based on any element pressed in the DOM.
$('div').on('click', function(e){ var parents = $(e.currentTarget).parents(); for (var i = 0; i < parents.length; i++) { if (parents[i].id === 'divToHide' || e.currentTarget.id === 'divToHide') {
It looks like your current element, as well as any of the parents, and checks if the identifier matches. If divToHide is in the parents () list, you can open a popup.
* NOTE: This requires wrapping the contents in a div wrapper or something similar.
source share