Event()
constructor 能用來建立一個 事件
。
語法
event = new Event(typeArg, eventInit);
參數
範例
// 建立一個 bubbles up 、並未被取消的事件 “look” 。
var ev = new Event("look", {"bubbles":true, "cancelable":false});
document.dispatchEvent(ev);
規格
Specification | Status | Comment |
---|---|---|
DOM The definition of 'Event()' in that specification. |
Living Standard | Initial definition. |
瀏覽器相容性
BCD tables only load in the browser