zoukankan      html  css  js  c++  java
  • EventTarge Node Docuement Element HTMLElement 关系

    综述:

    可以将其看做是依次继承的关系:

    Node

    Node

    A Node is an interface from which a number of DOM types inherit, and allows these various types to be treated (or tested) similarly(好几种dom类型都继承自node接口,这些dom类型对外会表现的很相似).

    The following interfaces(下面的这些接口都继承自Node的方法和属性,包括Document节点、Element节点等等) all inherit from Node its methods and properties: Document, Element, CharacterData (which Text, Comment, and CDATASection inherit), ProcessingInstruction, DocumentFragment, DocumentType, Notation, Entity, EntityReference

    These interfaces may return null in particular cases where the methods and properties are not relevant. They may throw an exception - for example when adding children to a node type for which no children can exist.

    Document

    Document

    Document接口为浏览器中的任何网页提供了统一的接口

    The Document interface represents any web page loaded in the browser(浏览器中的任何网页) and serves as an entry point into the web page's content, which is the DOM tree. The DOM tree includes elements such as <body> and <table>, among many others. It provides functionality global to the document, like how to obtain the page's URL and create new elements in the document.

    The Document interface describes the common properties and methods for any kind of document(为任何一种document文档都提供了普遍的属性和方法)Depending on the document's type(根据文档类型的不同,HTML类型的提供了HTMLDocument接口,XML和SVG提供了XMLDocument接口) (e.g. HTML, XML, SVG, …), a larger API is available: HTML documents, served with the text/html content type, also implement the HTMLDocument interface, whereas XML and SVG documents implement the XMLDocumentinterface.

    Element

    Element

    The Element interface represents an object of a Document.This interface describes methods and properties common to all kinds of elements.

    Element接口表示Document中的一个对象。这个接口为所有的Element接口提供了通用的方法和属性。

    Specific behaviors are described in interfaces which inherit from Element but add additional functionality(Element中的HTMLElement,SVGElement都继承自Element,并且有自己附加的方法和属性). For example, the HTMLElement interface is the base interface for HTML elements, while the SVGElement interface is the basis for all SVG elements.

    Languages outside the realm of the Web platform, like XUL through the XULElementinterface, also implement it.

    HTMLElement

    HTMLElement

    The HTMLElement interface represents any HTML element. Some elements directly implement this interface, others implement it via an interface that inherits it.

  • 相关阅读:
    修改UISearchBar的Cancel按钮为中文等本地化问题
    Xcode6 运行程序后,右侧Debug区域的Memory显示空白解决方法
    vuec常用插件
    clipboard 实现复制
    vue 表单操作
    vue 常用功能和命令
    关闭警告&关闭eslint
    vue 添加 fastclick的支持
    url编码函数encodeURI和encodeURIComponent
    jsencrypt加解密 &&cryptico
  • 原文地址:https://www.cnblogs.com/oneplace/p/6786193.html
Copyright © 2011-2022 走看看