EventTarge Node Docuement Element HTMLElement 關係

來源:互聯網
上載者:User

標籤:clu   elements   mozilla   directly   depend   represent   sid   not   amp   

綜述:

可以將其看做是依次繼承的關係:

 

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.

 

EventTarge Node Docuement Element HTMLElement 關係

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.