type property (style)
Specifies or returns the type of style sheet language.
If the value of this property is set, it overrides the default styleSheet language.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: type |
Possible values:
String that sets or retrieves the language type.
One of the following values:
Language : Cascading Style Sheets. | |||||||
Language : JavaScript. |
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the type attribute:
|
||||
<head> <style type="text/css"> H1 {border: 2px solid red;} </style> </head> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the type property:
|
||||
<head> <style id="baseStyle" type="text/css"> H1 {border: 2px solid red;} </style> <script type="text/javascript"> function GetStyleType () { var style = document.getElementById ("baseStyle"); alert ("The type of the first style element: " + style.type); } </script> </head> <body> <button onclick="GetStyleType ();">Get the type of the style!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
HTML elements:
Related pages:
External links:
User Contributed Comments