astralaaron Posted December 10, 2014 Share Posted December 10, 2014 Why would getElementsByTagName('a') be returning the href tag instread of giving me access to the anchor elements? function get_links(elm) {var container = document.getElementById(elm);var links = container.getElementsByTagName('a');console.log(links[0]);} I can't make any sense of this Link to comment Share on other sites More sharing options...
Ingolme Posted December 10, 2014 Share Posted December 10, 2014 What are you seeing in the console? Perhaps their representation of the data is confusing you. Try this: console.log(links[0].nodeName); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now