You are here: Reference > JavaScript > client-side > style handling > methods > removeProperty

removeProperty method

Browser support:
Removes the specified property from the current style object.
Note: The removeProperty method is supported in Internet Explorer from version 9.
In older Internet Explorer versions (and in newer ones as well), the removeAttribute method provides similar functionality.


object.removeProperty (propertyName);
You can find the related objects in the Supported by objects section below.


Required. String that specifies the name of the style property to remove. This parameter is not case sensitive.

Return value:

Returns a string that identifies the value of the removed style property. If no property is removed, it returns an empty string in Firefox and Opera, and returns null in Google Chrome and Safari.

Example HTML code 1:

This example illustrates the use of the removeProperty method:
    <script type="text/javascript">
        function RemoveBGColor (button) {
            if ( {
            else {
    <button onclick="RemoveBGColor (this);" style="background-color:red;">Remove my background color!</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content