How to remove an attribute from each matched elements using jQuery ? Last Updated : 28 Nov, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we will learn how to remove an attribute from each of the matched elements using JQuery. JQuery is the fastest and lightweight JavaScript library that is used to simplify the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript. It is widely famous for its motto of “Write less, do more.” It simply means that you can achieve your goal by just writing a few lines of code. Approach: An attribute is used to provide extra information about the element. It is always specified in the starting tag. We can easily remove attributes from the page by using removeAttr() method in JQuery. This method is used to remove an attribute from each of the matched elements. Syntax: selector.removeAttr( name ) Parameters: This method has a single parameter as mentioned above and described below. name: This is the name of the property that has to be removed from the page. The below example will help to understand the approach better. Example: In this example, we will be using removeAttr() method to remove an attribute from each of the matched elements. HTML <html> <head> <script type="text/javascript" src= "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"> </script> <style> body { text-align: center; } </style> </head> <body> <h1 style="color:green">GeeksforGeeks</h1> <table border="5px"> <tr> <td>This is first table</td> </tr> </table> <table border="6px"> <tr> <td>This is second table</td> </tr> </table> <table border="7px"> <tr> <td>This is third table</td> </tr> </table> <button id="btn">Click to remove</button> <script type="text/javascript"> $("#btn").click(function () { $("table").removeAttr("border"); }); </script> </body> </html> Output: Comment More infoAdvertise with us Next Article How to remove contents of elements using jQuery ? V volumezero9786 Follow Improve Article Tags : Web Technologies JQuery jQuery-Methods jQuery-Questions Similar Reads How to remove all attributes of an HTML element using jQuery ? In this article, we will see how to remove all attributes of an HTML element using jQuery. To remove all attributes of elements, we use the removeAttributeNode() method and .removeAllAttributes(). Syntax: $.fn.removeAllAttributes = function() { return this.each(function() { $.each(this.attributes, f 1 min read JQuery | Remove âdisabledâ attribute from an element There is an Input Element which is disabled, the task is to enable it using JQuery. Here are a few examples discussed. To understand example first few methods to know. JQuery prop() method This method set/return properties and values of selected elements. If we use this method to return the property 2 min read How to remove contents of elements using jQuery ? In this article, we will discuss how to remove the contents of the elements using jQuery. To remove the contents of elements, we will use the empty() method and the remove() method. The jQuery empty() method is used to remove all child nodes and their content for the selected elements. This method d 3 min read How to remove options from select element using jQuery ? Removing options from a select element using jQuery means programmatically deleting specific or all <option> elements within a <select> dropdown. This can be done using jQuery methods like remove() or empty(), allowing dynamic updates of the dropdown's available choices based on conditio 3 min read How to remove CSS âtopâ and âleftâ attribute with jQuery ? Method 1: Using the css() method: The css() method is used to get or set CSS properties of a selected element. It takes two arguments, the first argument is the property that has to be set and the second argument is the value that it has to be set to. The 'top' value can be effectively disabled by u 3 min read How to Remove HTML element from DOM using AngularJS ? In this article, we will see how to remove particular HTML elements from the DOM with the help of AngularJS, along with understanding its implementation through the examples. For this, we can use the remove() method that helps to remove all the selected elements including all the text. Syntax: selec 2 min read Like