XML DOM - Comment 對象
- 上一頁 DOM CSSStyleSheet
- 下一頁 DOM Document
Comment 對象表示文檔中注釋節點的內容。
Comment 對象
Comment 對象表示文檔中注釋節點的內容。
Comment 節點表示 HTML 或 XML 文檔中的注釋。
使用由 CharacterData 接口繼承的 data 屬性,或使用由 Node 接口繼承的 nodeValue 屬性,可以訪問注釋的內容。(即 <!-- 和 --> 之間的文本)。使用由 CharacterData 接口繼承的各種方法可以操作注釋的內容。
使用 Document.createComment() 來創建一個注釋對象。
Comment 對象方法
方法 | 描述 | IE | F | O | W3C |
---|---|---|---|---|---|
appendData() | 向節點追加數據。 | 6 | 1 | 9 | Yes |
deleteData() | 從節點刪除數據。 | 6 | 1 | 9 | Yes |
insertData() | 向節點中插入數據。 | 6 | 1 | 9 | Yes |
replaceData() | 替換節點中的數據。 | 6 | 1 | 9 | Yes |
substringData() | 從節點中提取數據。 | 6 | 1 | 9 | Yes |
相關頁面
XML DOM 參考手冊:CharacterData 對象
- 上一頁 DOM CSSStyleSheet
- 下一頁 DOM Document