JavaScript Tutorial/Style/item

Материал из Web эксперт
Перейти к: навигация, поиск

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

   <source lang="javascript">

<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>


<input type="button" value="Use Methods" onclick="useMethods()" /> </body> </html></source>