But if I do this:
It returns the link for the first
What am I doing wrong?
Just get the elements by tag name and avoid the
for in loop.
For your example, you would have used:
While that technically works, it returns prototype properties in addition to the link elements. This will throw errors since
.getAttribute("href") won’t work for all the return elements.