Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

insertRule method

Inserts a new rule into the media block.

Document Object Model (DOM) Level 2 Style Specification, Section 2.2Internet Explorer 9


var retval = CSSMediaRule.insertRule(bstrRule, lIndex);


bstrRule [in]

Type: String

The parsable text that represents the rule. For rule sets, this contains both the selector and the style declaration. For at-rules, this specifies both the at-identifier and the rule content.

lIndex [in]

Type: Integer

The index within the media block's rule collection. The rule is inserted immediately before this index. If the specified index is equal to the length of the media block's rule collection, the rule is added to the end of the media block.

Return value

Type: Integer

The index of the newly inserted rule within the media block's rule collection.

Standards information

See also




Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.