Remove Checked Attribute jQuery
Last Updated : Mar 11, 2024
In this article we will show you the solution of remove checked attribute jQuery, jQuery is the quickest and lightest JavaScript library used to make interactions between JavaScript and an HTML/CSS document, or even more specifically its document object model (DOM), simpler.
Method
To add further details about the element, an attribute is utilized.
It is almost always mentioned in the opening tag. With JQuery's removeAttr() method, we can quickly remove attributes from the page.
By using this technique, an attribute can be removed from each matching element.
Step By Step Guide On Remove Checked Attribute jQuery :-
<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">TalkersCode</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>
- The first step is to write <HTML>, which tells the browser what version of HTML we're using. A tag is the first element of an HTML document.
- Use the <head> tag to describe the project's heading. In contrast to the final brackets, which are closed, the title and final brackets both are open. External style sheets, also known as step-by-step style sheets, appear on a webpage based on the URL or path.
- Next, we create the font size and weight in style.
- Then we style by closing our eyes.
- The <script> tag was then added. The script tag also includes the javascript google API run or an explanation of the code or file we used.
- The script is then closed.
- The <body> tag, which describes the webpage's body, is then placed after this. This is where the website's content is written.
- Then we create a table using table draw, table row, table border.
- After that we create a button for removing functions.
- Then we again opened the <script> tag and then added. The script tag also includes the javascript google API run or an explanation of the code or file we used.
- After that we close </script> </body> </html>
Conclusion :-
The supplied attribute is removed from the element using this approach. In contrast to the removeAttributeNode() method, it is distinct.
The removeAttributeNode() method gets rid of a specific Attr object, whereas the removeAttribute() method gets rid of the attribute with the given name.
I hope this article on remove checked attribute jQuery helps you and the steps and method mentioned above are easy to follow and implement.