| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet/removeRule | [Back] [Original] |
Get to know MDN better
Avoid using this feature in new projects. This feature may be a candidate for removal from web standards or browsers.
The obsolete CSSStyleSheet method
removeRule() removes a rule from the stylesheet
object. It is functionally identical to the standard, preferred method
deleteRule().
Note:
This is a legacy method which has been replaced by
the standard method deleteRule(). You
should use that instead.
removeRule(index)
indexThe index into the stylesheet's CSSRuleList indicating the rule to be
removed.
None (undefined).
This example removes the first rule from the stylesheet myStyles.
myStyles.removeRule(0);
You can rewrite this to use the standard deleteRule() method very easily:
myStyles.deleteRule(0);
| Specification |
|---|
| CSS Object Model (CSSOM) # dom-cssstylesheet-removerule |
This page was last modified on Jul 26, 2024 by MDN contributors.
CSSStyleSheetCSSCSSConditionRuleCSSFontFeatureValuesMapCSSFontFeatureValuesRuleCSSFontPaletteValuesRuleCSSFunctionDeclarationsCSSFunctionDescriptorsCSSFunctionRuleCSSGroupingRuleCSSImportRuleCSSKeyframeRuleCSSKeyframesRuleCSSLayerBlockRuleCSSLayerStatementRuleCSSMediaRuleCSSNamespaceRuleCSSPageDescriptorsCSSPageRuleCSSPropertyRuleCSSRuleCSSRuleListCSSStartingStyleRuleCSSStyleDeclarationCSSStylePropertiesCSSStyleRuleCSSSupportsRuleCaretPositionMediaListMediaQueryListScreenStyleSheetStyleSheetListYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |