Scott Shanley4,309 Points
Looking for some help here. Tried everything, and can't move on without an answer...
Not sure if I'm just confused by the wording here or if it's something really simple i'm just overlooking. Super frustrating since I can't just see the answer after getting it wrong a thousand times.
Michael HuletiOS Development with Swift Treehouse Moderator 46,347 Points
It looks like you actually have the basic gist of this, but I see 2 issues:
- You have the right idea that the easiest thing to do here would be to reference the elements by a CSS selector, but the
getElementsByTagNamefunction only takes the name of a single kind of tag and returns an array of all elements of that tag in the page. In order to query the DOM using a CSS selector, you need to use the
querySelectorAllfunction, which takes a CSS selector as an argument and returns an array of all elements matching that selector
- You're selecting the wrong elements with your CSS selector. This step of the challenge asks you to select all links within the
navtag, but your selector targets all list items in an unordered list in the
navtag. I know it's fairly counterintuitive, but in HTML, a link is actually represented by the
Once you take care of those 2 issues, I think you'll be on the right track for this challenge. Great job!