The deleteRule() method of the CSSGroupingRule interface removes a CSS rule from a list of child CSS rules.
deleteRule(index)indexThe index of the rule to delete.
None (undefined).
IndexSizeError DOMExceptionThrown if index is greater than or equal to the number of child CSS rules.
InvalidStateError DOMExceptionThrown if the rule being removed is an @namespace at-rule, and the list of child CSS rules contains anything other than @import at-rules and @namespace at-rules.
let myRules = document.styleSheets[0].cssRules;
myRules[0].deleteRule(2); /* deletes the rule at index 2 */