Get style by item index (IE does not support DOM style methods) : item « Style « JavaScript Tutorial






<html>
<head>
<title>Style Example</title>
<script type="text/javascript">
    function useMethods() {
        var oDiv = document.getElementById("myDiv");
        alert(oDiv.style.item(0));
    }
</script>
</head>
<body>
<div id="myDiv" style="background-color: red; height: 50px; width: 50px"></div><br />
<input type="button" value="Use Methods" onclick="useMethods()" />
</body>
</html>








22.8.item
22.8.1.Get style by item index (IE does not support DOM style methods)