W3C DOM 支援哪些方法?
以下是 W3C DOM 支援的方法:
| 序號 | 屬性及描述 |
|---|---|
| 1 | createAttribute( name) 返回一個新建立的具有指定名稱的 Attr 節點。 例如:document.createAttribute( name) |
| 2 | createComment( text) 建立並返回一個包含指定文字的新 Comment 節點。 例如:document.createComment( text) |
| 3 | createDocumentFragment( ) 建立並返回一個空的 DocumentFragment 節點。 例如:document.createDocumentFragment( ) |
| 4 | createElement( tagName) 建立並返回一個具有指定標籤名稱的新 Element 節點。 例如:document.createElement( tagName) |
| 5 | createTextNode( text) 建立並返回一個包含指定文字的新 Text 節點。 例如:document.createTextNode( text) |
| 6 | getElementById( id) 返回此文件中 id 屬性值為指定值的 Element,如果文件中不存在此類 Element,則返回 null。 例如:document.getElementById( id) |
| 7 | getElementsByName( name) 返回文件中所有 name 屬性值為指定值的元素的節點陣列。如果未找到此類元素,則返回一個零長度陣列。 例如:document.getElementsByName( name) |
| 8 | getElementsByTagName( tagname) 返回此文件中所有具有指定標籤名稱的 Element 節點的陣列。Element 節點在返回的陣列中出現的順序與其在文件源中出現的順序相同。 例如:document.getElementsByTagName( tagname) |
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP