Javascript examples for DOM HTML Element:Anchor
Anchor rel Property - Set the value of the rel attribute to "nofollow":
<!DOCTYPE html> <html> <body> <p><a id="myAnchor" href="https://www.java2s.com">java2s.com</a></p> <button onclick="myFunction()">set the value of the rel attribute of the link above to "nofollow"</button> <p id="demo"></p> <script> function myFunction() {//from w ww.j ava 2s . c o m document.getElementById("myAnchor").rel = "nofollow"; document.getElementById("demo").innerHTML = "The value of the rel attribute of the link above is now 'nofollow'."; } </script> </body> </html>