Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Event
  4. explicitOriginalTarget

Event: explicitOriginalTarget property

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

Note: This feature is available inWeb Workers.

The read-onlyexplicitOriginalTarget property of theEvent interface returns the non-anonymous original target of the event.

If the event was retargeted for some reason other than an anonymous boundary crossing, this will be set to the target before the retargeting occurs.

For example, mouse events are retargeted to their parent node when they happen over text nodes (seeFirefox bug 185889), and in that casecurrentTarget will show the parent while this property will show the text node.

This property also differs fromoriginalTarget in that it will never contain anonymous content.

Value

Returns theEventTarget object, or null if there isn't one.

Example

This property can be used with<command> to get the event details of the original object calling the command.

js
function myCommand(ev) {  alert(ev.explicitOriginalTarget.nodeName); // returns 'menuitem'}
xml
<xul:command oncommand="myCommand(event);"/><xul:menulist>  <xul:menupopup>    <xul:menuitem label="Get my element name!" command="my-cmd-anAction"/>  </xul:menupopup></menulist>

Specifications

This is a Mozilla-specific property and is not part of any current specification. It is not on track to become a standard.

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp