Name

CSSStyleSheet.deleteRule( ): delete a rule from a stylesheet — DOM Level 2 CSS:

Synopsis

void deleteRule(unsigned longindex)
    throws DOMException;

Arguments

index

The index within the cssRules array of the rule to be deleted.

Throws

This method throws a DOMException with a code of INDEX_SIZE_ERR if index is negative or greater than or equal to cssRules.length. It throws a DOMException with a code of NO_MODIFICATION_ALLOWED_ERR if this stylesheet is read-only.

Description

This method deletes the rule at the specified index from the cssRules array. This is a DOM-standard method; see CSSStyleSheet.removeRule( ) for an IE-specific alternative.

Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.