How to get value of <a> tag in JavaScript
问题 I have this code: <html> <BUTTON ONCLICK="stups()">VALUE FINDER </BUTTON> <a value="this is a value" href="value"><img src="b5.jpg"> values rule!!</a> <p id="demo"></p> <script> var a = document.getElementsByTagName("a").value function stups(){ document.getElementById("demo").innerHTML=a } </script> </html> The javascript is simply meant to get the value of th (link) when the button is clicked I don't even know what is supposed to be the value whether it is th href attribute, the value