Javascript examples for DOM HTML Element:Anchor
Anchor text Property - Change the text content of a link
<!DOCTYPE html> <html> <body> <p><a id="myAnchor" href="http://www.example.com/test.htm#part2">Example link</a></p> <button onclick="myFunction()">change the text content of the link above</button> <script> function myFunction() {/*from w w w . j av a 2 s . c om*/ document.getElementById("myAnchor").text = "Click me to open example link!"; } </script> </body> </html>