CSSStyleDeclaration removeProperty() Method

Definition and Usage

removeProperty() The method removes the specified CSS property from the CSS declaration block.

Example

Remove the color property:

var declaration = document.styleSheets[0].cssRules[0].style;
var removedvalue = declaration.removeProperty("color");
alert(removedvalue);

Try it yourself

Syntax

object.removeProperty(propertyname)

Parameters

Parameters Description
propertyname Required. String representing the name of the attribute to be removed.

Technical Details

DOM Version: CSS Object Model
Return Value: String representing the old value of the removed attribute.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 9.0 Support Support Support