JavaScript Reference/Javascript Properties/cssText

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

"cssText" Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    document.all.myP1.style.cssText = "color:green;";
} 
</script>
<p id="myP1">Text Text Text Text Text Text Text Text </p>
<input type="button" value="Click to apply the style rules" onClick="function1();">
</body>
</html>



"cssText" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |runtimeStyle                    style                         |
|                |styleSheet                                                    |
+----------------+--------------------------------------------------------------+



"cssText" Syntax and Note

Note:
Read and write property. 
Sets an array of style sheet rules.
    
Syntax:
    
objectName.cssText = value