---
title: "jQuery removeAttr () method"  
description: "In JQuery removeAtrr () method is used to remove attributes from each matched elements. By using this method  we can create some custom attribute and"  
author: "Sachindra Singh"  
published: 2011-02-21  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/473/jquery-removeattr-method  
category: "jquery"  
tags: ["jquery"]  
reading_time: 2 minutes  

---

# jQuery removeAttr () method

In JQuery removeAtrr () method is used to remove attributes from each matched elements. By using this method we can create some custom attribute and remove attributes in element .In this article I am trying to show you, how we can use removeAttr () method to remove attributes of element on page as shown below:\

Syntax :**$( “element”).removeAttr (“name”);**

##### Code:

```
<title>JQuery removeAtrr method</title>       <script type="text/javascript" src="jquery.min.js">//add jquery library in script tag      </script>       <script type="text/javascript">         $(document).ready(function() //ready function contain all jquery function         {            $("#rcolor").click(function()            {                $("input").removeAttr("style");//removeAttr method will remove style attribute from all input tags            });         });     </script></head><body>     <table width="275" border="2" >         <tr>            <td align="center">               <label>Name</label>            </td>            <td align="center">                <input type="text" style="color: Red">            </td>          </tr>           <tr>            <td align="center">                <label>Age</label>            </td>            <td align="center">                <input type="text" style="color: Red">            </td>          </tr>           <tr>            <td align="center">               <label>City</label>            </td>            <td align="center">                <input type="text" style="color: Red">            </td>          </tr>           <tr>            <td align="center">                <label>College</label>            </td>            <td align="center">                <input type="text" style="color: Red">            </td>          </tr>     </table>     <button>         Submit</button>     &nbsp;&nbsp; <button id="rcolor">         Remove Color</button><!—button element with id--></body>
```

##### Screenshot

![jQuery removeAttr method](https://www.mindstick.com/mindstickarticle/52bfad44-48bf-472d-9c38-89e84a305e20/images/0bfe1d48-0b29-4966-9f6c-fa62943ea4e3.png)

If we want to remove font color from textboxes click on remove color button and red color will remove from font as shown below:

![jQuery removeAttr method](https://www.mindstick.com/mindstickarticle/52bfad44-48bf-472d-9c38-89e84a305e20/images/673d3927-ac3e-4451-a160-25441b038f8a.png)

---

Original Source: https://www.mindstick.com/articles/473/jquery-removeattr-method

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
