此頁面由社群從英文翻譯而來。了解更多並加入 MDN Web Docs 社群。

View in English Always switch to English

UIEvent()

Baseline
Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.

UIEvent() constructor 是用來建立新的 UIEvent

語法

 event = new UIEvent(typeArg, UIEventInit);

參數

typeArg

一個 String ,用來表示事件名稱

UIEventInit選擇性

一個 UIEventInit dictionary ,能接受以下參數:

detail

定義事件意義的值(類型:long,默認值:0)。關於事件的意義於 UIEvent.detail 已有較詳盡的列表。

view

與事件相關的 Window,默認值:null

規格

Specification
UI Events
# dom-uievent-uievent

瀏覽器支援度

延伸閱讀

  • UIEvent,此 constructer 所建立的 object 的 interface。