国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

DOM 元素 getAttribute() 方法

2018-12-02 14:52 更新

HTML DOM getAttribute() 方法

元素對象參考手冊 元素對象

實例

獲取鏈接的 target 屬性值:

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

輸出結(jié)果:

_blank

嘗試一下 ?

定義和用法

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

提示:如果你想返回屬性請使用 getAttributeNode 方法。


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


語法

element.getAttribute(attributename)

參數(shù)

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

返回值

類型 描述
String指定屬性值

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

DOM 版本Core Level 1 Element Object


元素對象參考手冊 元素對象

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號