Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

이 글은 기술 검토가 필요합니다. 도울을 줄 수 있는 방법을 살펴보세요.

이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 함께 해서 번역을 마치도록 도와 주세요!

The Event() constructor creates a new Event.

Syntax

 event = new Event(typeArg, eventInit);

Values

typeArg
Is a DOMString representing the name of the event.
eventInit Optional
Is an EventInit dictionary, having the following fields:
  • "bubbles": (Optional) A Boolean indicating whether the event bubbles. The default is false.
  • "cancelable": (Optional) A Boolean indicating whether the event can be canceled. The default is false.
  • "scoped": (Optional) A Boolean indicating whether the given event bubbles. If this value is truedeepPath will only contain a target node.
  • "composed": (Optional) A Boolean indicating whether the event will trigger listeners outside of a shadow root. The default is false. 

Example

// create a look event that bubbles up and cannot be canceled

var ev = new Event("look", {"bubbles":true, "cancelable":false});
document.dispatchEvent(ev);

Specifications

Specification Status Comment
DOM
The definition of 'Event()' in that specification.
Living Standard Initial definition.
Shadow DOM
The definition of 'scoped' in that specification.
Working Draft Adds scoped to EventInit dictionary.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
BasicSupport 15.0 11 (11) No support 11.60 Nightly build (535.2)
scoped 53.0 ? ? ? ?
Feature Android Android Webview Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support ? (Yes) 11.0 (11) ? ? ? (Yes)
scoped No support 53.0 ? ? ? ? 53.0

See also

문서 태그 및 공헌자

 이 페이지의 공헌자: jpmedley, svincent, Dattaya, romko391, fscholz, teoli
 최종 변경: jpmedley,