<html>
<body>
Read about the <a href="/demo/dom_obj_attributes.php" target="_blank">Attr object</a>.
<p id="demo">Click the button to display the value of the target attribute of the link above</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
var a=document.getElementsByTagName("a")[0];
var x=document.getElementById("demo");
x.innerHTML=a.getAttributeNode("target").value;
}
</script>
</body>
</html>