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

CSSStyleDeclaration item() 方法

CSS CSSStyleDeclaration CSS CSSStyleDeclaration

實例

返回 id 為 ex1 元素對應(yīng)樣式的第一個屬性名:

var style = document.getElementById("ex1").style; var propname = style.item(0); alert(propname);

運行代碼 ?

定義和使用

item() 方法返回 CSS 樣式中指定索引位置的屬性名,索引值從 0 開始。


瀏覽器支持

方法
item() Yes 9.0 Yes Yes Yes

語法

style.item(index)

屬性值

參數(shù) 描述
index 必需。一個數(shù)字,代碼 CSS 樣式屬性的索引位置。

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

DOM 版本: CSS Object Model
返回值: 字符串, 表示屬性名。

更多實例

實例

循環(huán)輸出元素的所有樣式的屬性名:

for (i = 0; i < elmnt.style.length; i++) { txt += elmnt.style.item(i) }

運行代碼 ?

CSS CSSStyleDeclaration CSS CSSStyleDeclaration

其他擴展