亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

javascript操作css屬性

 更新時(shí)間:2013年12月30日 15:35:10   作者:  
今天因需要用到j(luò)s獲取css屬性,網(wǎng)上搜了半天都不合適的。有一下幾種方法

復(fù)制代碼 代碼如下:

var getstyle = function(elementID,attribute){
 obj = document.getElementById(elementID);
// 前面是IE后面是html的標(biāo)準(zhǔn)
 return obj.currentStyle ? obj.currentStyle[attribute] : document.defaultView.getComputedStyle(obj, false)[attribute];
}

還有一種可以獲取寫在html中的style屬性的

復(fù)制代碼 代碼如下:

document.getElementById("elementId").style.paddingLeft;

相關(guān)文章

最新評(píng)論