Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Creates a new rule for a style sheet.
Syntax
plNewIndex = styleSheet .addRule( sSelector , sStyle [ , iIndex ] )Parameters
sSelector | Required. String that specifies the selector for the new rule. Single contextual selectors are valid. For example, " div p b " is a valid contextual selector. | ||
sStyle | Required. String that specifies the style assignments for this style rule. This style takes the same form as an inline style specification. For example, " color:blue " is a valid style parameter. | ||
iIndex | Optional. Integer that specifies the zero-based position in the rules collection where the new style rule should be placed.
|
Return Value
Reserved. Always returns -1 .
Remarks
You can apply rules to a disabled styleSheet , but they do not apply to the document until you enable the styleSheet .
Example
This example uses the addRule method to add a rule that sets all bold text appearing in a DIV to the color blue.
<STYLE> </STYLE>Standards Information
There is no public standard that applies to this method.
Applies To
|
styleSheet |
Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |