HTMLElement
HTMLElement 接口表示所有的 HTML 元素。一些HTML元素直接实现了HTMLElement接口,其它的间接实现HTMLElement接口.
属性
继承自父接口Element
和 GlobalEventHandlers
的属性
Event handlers
The events properties, of the form onXYZ
, are defined on the GlobalEventHandlers
, implemented by HTMLElement
. A few more are specific to HTMLElement
.
HTMLElement.onTouchStart
Non-Standard- Returns the event handling code for the
touchstart (en-US)
event. HTMLElement.onTouchEnd
Non-Standard- Returns the event handling code for the
touchend (en-US)
event. HTMLElement.onTouchMove
Non-Standard- Returns the event handling code for the
touchmove (en-US)
event. HTMLElement.onTouchEnter
Non-Standard- Returns the event handling code for the
touchenter
event. HTMLElement.onTouchLeave
Non-Standard- Returns the event handling code for the
touchleave
event. HTMLElement.onTouchCancel
Non-Standard- Returns the event handling code for the
touchcancel (en-US)
event.
方法
从父元素继承的方法, Element
.
Name & Arguments | Return | Description |
---|---|---|
HTMLElement.blur() (en-US) |
void |
元素失去焦点 |
HTMLElement.click() |
void |
触发元素的点击事件 |
HTMLElement.focus() (en-US) |
void |
元素获得焦点 |
HTMLElement.forceSpellCheck() (en-US)
Experimental
|
void |
规范
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module HTMLElement |
Working Draft |
添加如下属性:
|
HTML Living Standard HTMLElement |
Living Standard |
添加如下属性:
|
HTML5 HTMLElement |
Recommendation |
添加了如下属性:
|
Document Object Model (DOM) Level 2 HTML Specification HTMLElement |
Obsolete | 在 Document Object Model (DOM) Level 2 HTML Specification基础上没有任何改变 |
Document Object Model (DOM) Level 1 Specification HTMLElement |
Obsolete | 初始定义 |
浏览器兼容性
BCD tables only load in the browser