2013-06-06 35 views

回答

0

這些通常反映爲元素實例的屬性。例如,大多數其他人都是如此。有些人稍重命名的名稱(htmlFor而不是forclassName代替class),但在大多數情況下它是1:1(targettargetactionaction,...)。

參考文獻:

4

最近我有類似的問題,你可以得到元素的特性與window.getComputedStyleelement.currentStyle方法:

var elem = document.getElementById('test'); 
    if (window.getComputedStyle) { // all browsers 
     cs = window.getComputedStyle(elem, null).getPropertyValue('direction'); 
    } else { 
     cs = elem.currentStyle.direction; // IE5-8 
    } 
    alert(cs); 

jsfiddle; compatibility info

相關問題