Open In App
Related Articles

CSS Style Declaration removeProperty() Method

Improve Article
Save Article
Like Article

The removeProperty() method is used to remove the existing CSS property

Syntax: It is used to remove the specified CSS property.


Parameters: It accepts a single parameter:

  • propertyname: It is a required parameter that contains a string that represents the name of the property to be removed.

Return value: It returns the value of the removed property in the form of a string. 

Example: To show the working of the removeProperty() method


<!DOCTYPE html>
        CSS | Style Declaration removeProperty() Method
        body {
            text-align: center;
        h1 {
            color: green;
        #p1 {
            color: green;
            font-size: 20;
            background-color: black;
    <p id="p1"> removeProperty() Method</p>
    <button onclick="myFunction()">
        Remove property
    <p id="gfg"></p>
    <!-- Script to remove the property -->
        function myFunction() {
            let x =
            // Remove the background color property.
            let propertyRemoved =
                "gfg").innerHTML =
                "Property removed is background-color i.e."
                + propertyRemoved;


Supported Browsers: The browsers supported by Style Declaration removeProperty() Method are listed below:

  • Google Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 12.1
  • Safari 1

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 03 Aug, 2023
Like Article
Save Article
Similar Reads
Complete Tutorials