HTML DOM getAttributeNode() 方法
定義和用法
getAttributeNode() 方法從當前元素中通過名稱獲取屬性節點。
提示:如果你僅想返回屬性值請使用getAttribute方法。
瀏覽器支持
所有主要瀏覽器都支持getAttributeNode() 方法
語法
element.getAttributeNode( attributename )
參數
参数 | 类型 | 描述 |
---|---|---|
attributename | String | 必须。你想返回的属性名。 |
返回值
类型 | 描述 |
---|---|
Attr object | 指定的属性节点 |
技術細節
DOM 版本 | Core Level 1 Element Object |
---|