views:

70

answers:

1

Hi folks!

Executing this JavaScript:

window.addEventListener("contextmenu", function(e) { afunction(e); }, true);

function updateReflectMenu(anEvent) {
  var elemUnderMouse = anEvent.target;
  alert(elemUnderMouse);
}

within an AddOn in FF3.5 gives me something like:

[object XPCNativeWrapper [object HTMLSpanElement]]
Exactly what I'm loocking for. Executed with FF1.5 or 2.x I get:
[object XULElement]
Unfortunatelly I was unable to find any information about that! Any help is much appreciated. Thanks in advance.

+1  A: 

anEvent.originalTarget

https://developer.mozilla.org/en/DOM/event.originalTarget

tested with FF 1.5, 2.0 and 3.5!

dforce