HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

jQuery removeAttr() Method

jQuery HTML/CSS Methods jQuery HTML/CSS Methods

Example

Remove the style attribute from all <p> elements:

$("button").click(function(){
  $("p").removeAttr("style");
});

Try it yourself »

Definition and Usage

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


Syntax

$(selector).removeAttr(attribute)

Parameter Description
attribute Required. Specifies one or more attributes to remove. To remove several attributes, separate the attribute names with a space


Examples

Try it Yourself - Examples

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


jQuery HTML/CSS Methods jQuery HTML/CSS Methods


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE