Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
brandonlind2
7,823 PointsWhy isn't this children property working?
What am I doing wrong?
document.getElementsByTagName('nav').children;
1 Answer
Tushar Singh
Courses Plus Student 8,692 PointsHint, you are missing something with your children property.
Will .toUpperCase work? Nope
brandonlind2
7,823 PointsI dont think children is a method I tried it though to see and its not working. I'm confused because I thought children was a property with an array value of the elements children but a lot of the elements dont seem to have it a property. It looks like i'm adding an empty property to a lot of element when I try using this? I'm testing in the treehouse site console
brandonlind2
7,823 Pointsnevermind I figured it out I needed to specify it was the first in the array returned by .getElementsByTagName
document.getElementsByTagName('nav')[0].children;
jsdevtom
16,963 Pointsjsdevtom
16,963 PointsPlease either: