[Event Target] Can't identify clicked element id

[Event Target] Can't identify clicked element id

I'm pretty new to this forum, so Hello Everyone ;)

I have written this proto to fadeout/close my "hint/tooltip" div, when i ckick anywhere in the page.

  1. Element.prototype.hintClickOut = function(hint_id) {
  2.      var el=this;
  3.      $('*').click( function(event) {
  4.            var e = window.event || event;
  5.            var targ = e.target || e.srcElement;
  6.            if(targ.id == el.id) return;
  7.           
  8.            $('#'+hint_id).fadeOut(500, function() { $(this).remove(); });
  9.                    
  10.      });
  11. }

and i call it on a HTML Select, by onChange event listener.

It works fine in Chrome, but NOT in Firefox.

The problem is, when i perform this check

  1. if (targ.id == el.id) return;

to avoid closing my element after clicking it's select (el.id refers to the select id)

Firefox doesn't "return", and so it goes on and reaches the "fadeout/close" line.

Maybe there's a way to check ALL the objects inside "event target" and,
IF if find one element which has "id == el.id", THEN return;

Hope I have made that clear.
TY ;)