Javascript examples for DOM HTML Element:Anchor
Anchor target Property - Return the value of the target attribute of a link:
<!DOCTYPE html> <html> <body> <p><a target='_blank' id="myAnchor" href="https://www.java2s.com">java2s.com</a></p> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w . ja v a 2s.com var v = document.getElementById("myAnchor").target; document.getElementById("demo").innerHTML = v; } </script> </body> </html>