JavaScript Reference/Javascript Objects/styleSheet

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

"styleSheet" CSS Attributes and JavaScript Style Properties

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



"styleSheet" Example

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



"styleSheet" JavaScript Collections

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



"styleSheet" JavaScript Methods

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



"styleSheet" JavaScript Properties

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



"styleSheet" Syntax and Note

Note:
Represents a single style sheet, and it is only accessible through the 
styleSheets collection.
    
Syntax:
    
document.styleSheets(index).memberName