参考文档: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. 微信支付 - iOS

    前言 大家都说微信支付很麻烦,我看了一下 就做一下记录吧 正文 一: 1.微信开发网站:https://open.weixin.qq.com 注册一个开发者账号,申请一个app,(大概7个工作日,但是 ...

  2. 【Java基础】线程和并发机制

    前言 在Java中,线程是一个很关键的名词,也是很高频使用的一种资源.那么它的概念是什么呢,是如何定义的,用法又有哪些呢?为何说Android里只有一个主线程呢,什么是工作线程呢.线程又存在并发,并发 ...

  3. MySQL入门笔记(一)

    一.数据类型 1. 整型 2. 浮点型 3. 字符型 4. 日期时间型 二.数据库操作 1. 创建库 CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_nam ...

  4. Spring+SpringMVC+MyBatis+easyUI整合基础篇(一)项目简介

    很久之前就打算开始写一下自己的技术博客了,实在抽不出时间所以计划一直搁置了,最近项目进度渐渐缓了下来,不那么忙了,也因此开始筹备自己的博客.说到这次博客的主角,也是无心插柳找到的,来源于两年前自己写的 ...

  5. BOM元素之window对象

    在浏览器中,window对象有双重角色,它既是通过JavaScript访问浏览器窗口的一个接口,又是ECMAScript规定的Global对象.这意味着在网页中定义的任何一个对象.变量和函数,都以wi ...

  6. 数据库读写分离Amoeba

    1.理解读写分离的原理 Amoeba(变形虫)项目,该开源框架于2008发布一款Amoeba for mysql软件,该软件致力于mysql的分布式数据库前端代理层,主要的作用是应用服务访问mysql ...

  7. mysql 命令备份

    导出要用到MySQL的mysqldump工具,基本用法是:    shell> mysqldump [OPTIONS] database [tables]    如果你不给定任何表,整个数据库将 ...

  8. 转:Apache 与 Nginx 比较

    Nginx 轻量级,采用 C 进行编写,同样的 web 服务,会占用更少的内存及资源 抗并发,nginx 以 epoll and kqueue 作为开发模型,处理请求是异步非阻塞的,负载能力比 apa ...

  9. 基于MAC10.12+MYSQL5.7.17搭建XMPP服务器【黑苹果系统】

    在以前的公司中了解到XMPP可以搭建即时通讯APP.出于好奇自己在空余时间也学了一下搭建XMPP服务器,其中遇到了许多问题,经过坎坷的路程终于搭建成功[这些坎坷的经历主要是由于自己的无知造成的] 下面 ...

  10. Spring框架中 配置c3p0连接池 完成对数据库的访问

    开发准备: 1.导入jar包: ioc基本jar jdbcTemplate基本jar c3p0基本jar 别忘了mysql数据库驱动jar 原始程序代码:不使用配置文件方式(IOC)生成访问数据库对象 ...