参考文档: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

HTMLElement的更多相关文章

  1. DOM笔记(三):Element接口和HTMLElement接口

    一.Element接口 Element接口表示一个元素,该接口扩展自Node接口,自然继承了Node接口的属性和方法,也有一套针对元素的属性和方法. Element接口常见的属性比较少,常用的就是一个 ...

  2. HTMLElement.hidden; CSS Attr Selectors的用处; DOM的className方法; ::before和::after伪元素

    https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/hidden https://codepen.io/pen/ <elem ...

  3. EventTarge Node Docuement Element HTMLElement 关系

    综述: 可以将其看做是依次继承的关系: Node Node A Node is an interface from which a number of DOM types inherit, and a ...

  4. TypeError: Cannot read property '$$' of undefined at HTMLElement._attached.wx.getPlatform._touchstartHandlerForDevtools

    TypeError: Cannot read property '$$' of undefined     at HTMLElement._attached.wx.getPlatform._touch ...

  5. 关于Typescript - HTMLElement上使用append / prepend函数的问题

    因最近在做浏览器打印界面水印的问题,用到后台动态创建标签,样式的处理用到了append,prend函数,Angular build打包的时候却抛出了异常↓ ERROR in src/app/route ...

  6. 在angular项目中使用bootstrap的tooltip插件时,报错Property 'tooltip' does no t exist on type 'JQuery<HTMLElement>的解决方法和过程

    在angular4的项目中需要使用bootstrap的tooltip插件. 1. 使用命令安装jQuery和bootstrap npm install bootstrap jquery --save ...

  7. React报错之Property 'X' does not exist on type 'HTMLElement'

    正文从这开始~ 总览 在React中,当我们试图访问类型为HTMLElement 的元素上不存在的属性时,就会发生Property 'X' does not exist on type 'HTMLEl ...

  8. React报错之Property 'value' does not exist on type 'HTMLElement'

    正文从这开始~ 总览 当我们试图访问一个类型为HTMLElement的元素上的value属性时,会产生"Property 'value' does not exist on type 'HT ...

  9. 将HTML格式的String转化为HTMLElement

    代码如下: <meta charset="UTF-8"> <title>Insert title here</title> </head& ...

随机推荐

  1. JS数组处理

    一.定义数组: 方法1 var myCars=new Array(); myCars[0]="Saab"; myCars[1]="Volvo"; myCars[ ...

  2. swift2.0 字符串,数组,字典学习代码

    swift 2.0 改变了一些地方,让swift变得更加完善,这里是一些最基本的初学者的代码,里面涉及到swift学习的最基本的字符串,数组,字典和相关的操作.好了直接看代码吧. class View ...

  3. .NET 十五岁,谈谈我眼中的.NET

    2002年2月13日,第一个版本随着visual studio.net的发布,今天已经走过15年, .net团队写了一篇文章,里面有一个视频,Anders Hejlsberg已是白发苍苍的老人,我也从 ...

  4. matlab中同一文件定义子函数的方法

    在matlab中一个.m文件中可以有多个的子函数,但仅能有一个主函数,并且M文件名必须和主函数相同在一个m文件中通常有两种定义子函数的方法: 1.嵌套定义 myfunc1会和主函数共享变量名.这种情况 ...

  5. Giraph入门

    概要 这是一个Giraph的入门教程,主要用来运行少量输入的Giraph程序,并不能用于生产环境. 在这个教程中,我们将会在一个物理机器行部署一个单节点,伪分布的Hadoop集群.这个节点既是mast ...

  6. MySQL架构由小变大的演变过程

    假设一个网站(discuz)从最开始访问量很小做到日pv千万,我们来推测一下它的mysql服务器架构演变过程. 第一阶段网站访问量日pv量级在1w以下.单台机器跑web和db,不需要做架构层调优(比如 ...

  7. BZOJ 3208: 花神的秒题计划Ⅰ

    这就是一道滑雪嘛= = 所有操作都爆力,求路径就dp,完了 CODE: #include<cstdio>#include<iostream>#include<algori ...

  8. 服务器 'XXXXXX' 上的 MSDTC 不可用。解决方法

    今天在C#中操作数据库的时候突然发现这个问题:服务器 'USER-XXX' 上的 MSDTC 不可用. 解决方法: 在windows控制面板 --> 管理工具 --> 服务 --> ...

  9. Hello,Kubernetes

    什么是Kubernetes Kubernetes(k8s)是一款开源的以容器为中心的,用于跨主机集群自动部署(automating deployment),控制容器扩展/收缩(scaling)和管理容 ...

  10. Java程序通过代理访问网络

    问题背景 最近工作上有开发爬虫的任务,对目标网站数据进行抓取,由于大部分网站都在国外,无法直接访问,需要通过代理才能登录.爬虫部署的服务器在香港,所以爬虫部署到服务器后,是可以访问目标网站的,但本地开 ...