XML DOM createEvent() 方法

Document ɗanar Kita

定义和用法

createEvent() 方法创建新的 Event Object.

语法:

createEvent(eventType)
Parameter 描述
eventType

想获取的 Event 对象的事件模块名。

关于有效的事件类型列表,请参阅“Description部分。

Return Value

Returns the newly created Event Object, with the specified type.

throw

If the implementation supports the required event type, the method will throw a NOT_SUPPORTED_ERR code DOMException Exception.

Description

This method will create a new event type, which is specified by the parameter eventType specified. Note that the value of this parameter is not the name of the event interface to be created, but the name of the DOM module that defines that interface.

The following table lists eventType Legal Values and Each Value to Create an Event Interface:

Parameter Event Interface Initialization Method
HTMLEvents HTMLEvent iniEvent()
MouseEvents MouseEvent iniMouseEvent()
UIEvents UIEvent iniUIEvent()

Bayan a kafa Event ɗanar da shi, a kai kuma yi amfani da ɗanar da a ƙasa ɗanar samu shi. Babban ɗanar Event ɗanar Kita.

Dukiya na saukar a fannin DocumentEvent ɗanar, kuma ba dukkanin fannin Document ɗanar ba. Idan kuma aka samu fannin Event ɗanar, don haka Document ɗanarDukiya za a samu DocumentEvent ɗanar da aka samu shi. Dukiya za a samu shi

Document ɗanar Kita