jQuery removeProp() method

The jQuery removeProp() method can be used to remove the property of the selected elements. It can remove single or multiple properties from the elements you select.

jQuery removeProp() method

Syntax

The syntax of the method is given below.

Syntax
$(selector).removeProp(property)

Description of the Parameters

There are two parameters whose descriptions are given below.

Parameter Name Description
selector You have to use a selector to select the elements and remove the properties. You can use the tag name, class name, or id of the elements to select.
property Specify the property of the element to remove.

Let’s find out the uses with the examples given below.

jQuery removeProp() Method Remove Single Property

If you want to remove a single property, you have to use the example given below. It contains a paragraph and a button element. The example uses the button click event to remove the property.

Example

Test it Live

Output

This is my paragraph.

The property in the class attribute applies the border and padding to the paragraph. When you click the button given above, you can find the difference if the class gets removed.

You may also like to read

I hope you like this tutorial on jQuery removeProp() method. If you have any queries regarding the tutorial, please comment below.

References