files/en-us/web/api/cssstylesheet/removerule/index.md
{{APIRef("CSSOM")}}{{deprecated_header}}
The obsolete {{domxref("CSSStyleSheet")}} method
removeRule() removes a rule from the stylesheet
object. It is functionally identical to the standard, preferred method
{{domxref("CSSStyleSheet.deleteRule", "deleteRule()")}}.
[!NOTE] This is a legacy method which has been replaced by the standard method {{domxref("CSSStyleSheet.deleteRule", "deleteRule()")}}. You should use that instead.
removeRule(index)
index
None ({{jsxref("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);
{{Specifications}}
{{Compat}}