Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery removeAttr() method

jQuery removeAttr() method

jQuery HTML/CSS methods jQuery HTML/CSS methods

Example

Remove the style attribute from all the

elements:

$

(

"

button

"

)

.

click

(

function

(

)

{

$

(

"

p

"

)

.

removeAttr

(

"

style

"

)

;

}

)

;

Try it »


Definition and Usage

The removeAttr() method removes one or more attributes from the selected elements.


Syntax

$(

selector

).removeAttr(

attribute

)

Parameters Description
attribute Required. Specifies one or more attributes to remove. To remove several attributes, separate the attribute names with spaces.

More examples

Removing several attributes from the selected elements
How to remove the id and class attributes from the selected elements.


jQuery HTML/CSS methods jQuery HTML/CSS methods