Skip to content
Related Articles

Related Articles

Improve Article

jQuery | removeAttr() with Examples

  • Last Updated : 03 Aug, 2021
Geek Week

The removeAttr() method is an inbuilt method in jQuery which is used to remove one or more attributes from the selected elements.



Parameters: This function accepts single parameter attribute which is mandatory. It is used to specify one or more attributes to remove. Several attributes can be separated using space operator.

Return Value: This method returns the selected element with the removed attribute.

Below example illustrates the removeAttr() method in jQuery:


<!DOCTYPE html>
       <title>The removeAttr Method</title>
       <script src=
        <!-- jQuery code to show the working of this method -->
            $(document).ready(function() {
            $("button").click(function() {
         div {
             width: 300px;
             min-height: 150px;
             border: 2px solid green;
             padding: 20px;
         <!-- click on the any of the paragraph
         and see the change -->
         <p style="font-size:35px;font-weight:bold;
                       color:green;">Welcome to</p>
         <p style="font-size:35px;font-weight:bold;
         <button>Click Here!</button>

removeAttr method

jQuery is an open source JavaScript library that simplifies the interactions between an HTML/CSS document, It is widely famous with it’s philosophy of “Write less, do more”.
You can learn jQuery from the ground up by following this jQuery Tutorial and jQuery Examples.

Hey geek! The constant emerging technologies in the world of web development always keeps the excitement for this subject through the roof. But before you tackle the big projects, we suggest you start by learning the basics. Kickstart your web development journey by learning JS concepts with our JavaScript Course. Now at it’s lowest price ever!

My Personal Notes arrow_drop_up
Recommended Articles
Page :