So I have an Element Array retrieved using this line of code:
var listItems = ul[0].getElementsByTagName("li")
The output of
console.log(listItems[0].innerHTML)
gives me
<a class="view" href="https://www.notarealwebsite.com">See this cool link!</a>
How can I retrieve only the link (https://www.notarealwebsite.com) using pure Javascript?
I have tried the getAttribute("href") function to no avail.
Thanks!