Home
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <style> .myCls { color: green; font-size: 20px; } </style> <script> $(document).ready(function () { $("button").click(function () { $("div").removeAttr('style'); $(".myCls").removeAttr('class'); $("input[type='text']").removeAttr('disabled'); }); }); </script> </head> <body> <h1>jQuery Manipulation Methods: removeAttr()</h1> <div style="color:red;font-size:25px;">This is a div tag</div> <div class="myCls"> <p>This is a paragraph</p> </div> <input type="text" value="Testing removeAttr()" disabled /><br/><br/> <button>Click Me to Test .removeAttr()</button> </body> </html>
Result: