JavaScript Reference/Javascript Objects/styleSheet

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

"styleSheet" CSS Attributes and JavaScript Style Properties

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | CSS |text-autospace | +----------------+--------------------------------------------------------------+

     </source>
   
  


"styleSheet" Example

   <source lang="javascript">
   

<html> <body> <style>body {background-color: white;}</style> <button onclick="document.styleSheets(0).rules(0).style.backgroundColor = "blue";"> Change color </button> </body> </html>


     </source>
   
  


"styleSheet" JavaScript Collections

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | JavaScript |imports pages | | Collections |rules | +----------------+--------------------------------------------------------------+

     </source>
   
  


"styleSheet" JavaScript Methods

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | JavaScript |addImport addPageRule | | Methods |addRule fireEvent | | |removeRule | +----------------+--------------------------------------------------------------+

     </source>
   
  


"styleSheet" JavaScript Properties

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | JavaScript |canHaveHTML cssRules | | Properties |cssText disabled | | |href id | | |isContentEditable isDisabled | | |isMultiline media | | |owningElement parentStyleSheet | | |readOnly title | | |type | +----------------+--------------------------------------------------------------+

     </source>
   
  


"styleSheet" Syntax and Note

   <source lang="javascript">

Note: Represents a single style sheet, and it is only accessible through the styleSheets collection.

Syntax:

document.styleSheets(index).memberName


     </source>