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
Emilio Meira
11,059 PointsCode problems...
Guys, on the course "Interactive Web Pages with JavaScript", "Selecting Elements" challenge, objective #2, if I paste the code below:
var fullName = document.getElementById("full_name"); var lastName = document.getElementByTagName("span")[1];
The previous objective stops passing. Can you tell me what's wrong?
Thanks,
Emilio
2 Answers
Simon Coates
28,695 PointsThe second line should be
var lastName = document.getElementsByTagName("span")[1];
Emilio Meira
11,059 PointsThanks, guys, that was it! The funny thing, though, is that it started telling me that task one was no longer passing instead of giving me a syntax error. But I guess workspace is not a full compiler, hence why... :)
Simon Coates
28,695 Pointsyep, you can occasionally get incorrect messages, which can be related to how verification of a task is accomplished (which varies)
Kofi Owusu Acheampong
20,320 PointsKofi Owusu Acheampong
20,320 PointsYes, your answer should be as above. The difference being that you are missing the character
sin your method name.document.getElementsByTagName