中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

HTML DOM getAttribute() 方法

元素對(duì)象參考手冊(cè) 元素對(duì)象

實(shí)例

獲取鏈接的 target 屬性值:

document.getElementsByTagName("a")[0].getAttribute("target");

輸出結(jié)果:

_blank

運(yùn)行代碼 ?

定義和用法

getAttribute() 方法通過名稱獲取屬性的值。

提示:如果你想返回屬性請(qǐng)使用 getAttributeNode 方法。


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 getAttribute() 方法


語(yǔ)法

element.getAttribute(attributename)

參數(shù)

參數(shù) 類型 描述
attributename String 必須。你想獲取的屬性值。

返回值

類型 描述
String 指定屬性值

技術(shù)細(xì)節(jié)

DOM 版本 Core Level 1 Element Object

元素對(duì)象參考手冊(cè) 元素對(duì)象

其他擴(kuò)展