HTML Event type

1.6.5. HTML event types

The HTML event module is composed of events listed in HTML 4.0 and additional events which are supported in DOM Level 0 browsers.

A DOM application may use the hasFeature(feature, version) method of the DOMImplementation interface with parameter values "HTMLEvents" and "2.0" (respectively) to determine whether or not the HTML event module is supported by the implementation. In order to fully support this module, an implementation must also support the "Events" feature defined in this specification. Please, refer to additional information about conformance in the DOM Level 2 Core specification [DOM Level 2 Core].

Note: To create an instance of the Event interface for the HTML event module, use the feature string "HTMLEvents" as the value of the input parameter used with the createEvent method of the DocumentEvent interface.

The HTML events use the base DOM Event interface to pass contextual information.

The different types of such events that can occur are:

load
The load event occurs when the DOM implementation finishes loading all content within a document, all frames within a FRAMESET, or an OBJECT element.
  • Bubbles: No
  • Cancelable: No
  • Context Info: None
unload
The unload event occurs when the DOM implementation removes a document from a window or frame. This event is valid for BODY and FRAMESET elements.
  • Bubbles: No
  • Cancelable: No
  • Context Info: None
abort
The abort event occurs when page loading is stopped before an image has been allowed to completely load. This event applies to OBJECT elements.
  • Bubbles: Yes
  • Cancelable: No
  • Context Info: None
error
The error event occurs when an image does not load properly or when an error occurs during script execution. This event is valid for OBJECT elements, BODY elements, and FRAMESET element.
  • Bubbles: Yes
  • Cancelable: No
  • Context Info: None
select
The select event occurs when a user selects some text in a text field. This event is valid for INPUT and TEXTAREA elements.
  • Bubbles: Yes
  • Cancelable: No
  • Context Info: None
change
The change event occurs when a control loses the input focus and its value has been modified since gaining focus. This event is valid for INPUT, SELECT, and TEXTAREA. element.
  • Bubbles: Yes
  • Cancelable: No
  • Context Info: None
submit
The submit event occurs when a form is submitted. This event only applies to the FORM element.
  • Bubbles: Yes
  • Cancelable: Yes
  • Context Info: None
reset
The reset event occurs when a form is reset. This event only applies to the FORM element.
  • Bubbles: Yes
  • Cancelable: No
  • Context Info: None
focus
The focus event occurs when an element receives focus either via a pointing device or by tabbing navigation. This event is valid for the following elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.
  • Bubbles: No
  • Cancelable: No
  • Context Info: None
blur
The blur event occurs when an element loses focus either via the pointing device or by tabbing navigation. This event is valid for the following elements: LABEL, INPUT, SELECT, TEXTAREA, and BUTTON.
  • Bubbles: No
  • Cancelable: No
  • Context Info: None
resize
The resize event occurs when a document view is resized.
  • Bubbles: Yes
  • Cancelable: No
  • Context Info: None
scroll
The scroll event occurs when a document view is scrolled.
  • Bubbles: Yes
  • Cancelable: No
  • Context Info: None
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值