DOM--(Element)

【屬性】

element.attributes  包含一系列節點
element.attributes["id"].nodeName 返回特性名稱
element.attributes["id"].nodeValue 返回特性值

【方法】

取得屬性的特性  X.getAttribute(屬性名)

設置屬性的特性  x.setAttribute(屬性名,屬性值)

刪除屬性 x.removeAttribute(屬性名)

比較兩個節點是否相同(引用同個對象) x.isSameNode(xx)

比較兩個節點是否相等(類型、屬性、attributes、childNodes相同) x.isEqualNode(xx)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章