参考文档:MDN HTMLElement

一、继承关系

  1. 所有HTML元素都是由HTMLElement或者其更具体的子类型来表示的。

二、属性方法

    1. 例:innerHTML, className, id

    2. 自身属性

属性名称

属性类型

Description

HTMLElement.accessKey

DOMString

分配给元素的access key

HTMLElement.accessKeyLabel

DOMString

A string that represents the element's assigned access key.

HTMLElement.contentEditable

DOMString

获取/设置元素的可编辑状态

HTMLElement.isContentEditable 只读

Boolean

指示元素的内容是否可被编辑

HTMLElement.dataset 只读

DOMStringMap

允许读写元素的自定义data特性(data-*)

HTMLElement.dir

DOMString

获取/设置元素的方向

HTMLElement.draggable

Boolean

HTMLElement.dropzone 只读

DOMSettableTokenList

HTMLElement.hidden

Boolean

HTMLElement.itemScope

Boolean

HTMLElement.itemType 只读

DOMSettableTokenList

HTMLElement.itemId

DOMString

HTMLElement.itemRef 只读

DOMSettableTokenList

HTMLElement.itemProp 只读

DOMSettableTokenList

HTMLElement.itemValue

any

HTMLElement.lang

DOMString

获取/设置元素属性、文本、内容的语言(Gets/sets the language of an element's attributes, text, and element contents).

HTMLElement.offsetHeight 只读

double

The height of an element, relative to the layout.

HTMLElement.offsetLeft只读

double

The distance from this element's left border to its offsetParent's left border.

HTMLElement.offsetParent只读

Element

The element from which all offset calculations are currently computed.

HTMLElement.offsetTop只读

double

The distance from this element's top border to its offsetParent's top border.

HTMLElement.offsetWidth只读

double

The width of an element, relative to the layout.

HTMLElement.properties 只读

HTMLPropertiesCollection

HTMLElement.spellcheck

Boolean

Controls spell-checking (present on all HTML elements)

HTMLElement.style

CSSStyleDeclaration

An object representing the declarations of an element's style attributes.

HTMLElement.tabIndex

long

Gets/sets the position of the element in the tabbing order.

HTMLElement.title

DOMString

A string that appears in a popup box when mouse is over the element.

HTMLElement.translate

Boolean

    1. 实现了GlobalEventHandlers的event属性:所有onXYZ形式(如:onClick)
    2. HTMLElement.onTouchStart 

      Returns the event handling code for the touchstart event.

      HTMLElement.onTouchEnd 

      Returns the event handling code for the touchend event.

      HTMLElement.onTouchMove 

      Returns the event handling code for the touchmove event.

      HTMLElement.onTouchEnter 

      Returns the event handling code for the touchenter event.

      HTMLElement.onTouchLeave 

      Returns the event handling code for the touchleave event.

      HTMLElement.onTouchCancel 

      Returns the event handling code for the touchcancel event.

    1. 继承自父接口Element的方法
    2. 自身方法

Name & Arguments

Return

Description

HTMLElement.blur()

void

从当前已经获得焦点的元素上移除键盘焦点(Removes keyboard focus from the currently focused element).

HTMLElement.click()

void

在该元素上触发click事件(Sends a mouse click event to the element).

HTMLElement.focus()

void

让当前元素获取焦点(Makes the element the current keyboard focus).

HTMLElement.forceSpellCheck()

void

05-06 13:37