Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Remove an Attribute from an Element</title> </head> <body> <a href="https://www.google.com/" id="myLink">Google</a> <script> // Selecting the element let link = document.getElementById("myLink"); // Removing the href attribute link.removeAttribute("href"); </script> </body> </html>