JavaScript DHTML/Style Layout/Rule

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

Style rule "selectorText" Example

   <source lang="html4strict">
   

<html> <body> <style>

  1. myP { font-family:verdana, arial; font-weight:bold; font-size:16px; }

</style> <script language="JavaScript">

   function function1() {
       alert(document.styleSheets[0].rules[0].selectorText);
   }

</script>

Sample text.

<input type="button" value="Selector Text" onclick="function1()"> </body> </html>


     </source>