Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

jQuery removeAttr() Method

❮ 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

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