Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> </head> <body> <a href="#">Link </a> <button type="button" class="remove-attr"> Remove Link</button> <script> $(document).ready(function() { $(".remove-attr").click(function() { $("a").removeAttr("href"); }); }); </script> </body> </html>