Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Selecting Elements Challenge: Task 1 No Longer passes after I answer Task 2

Working through "Interactive Web Pages in JS." My code for Task 1 passes with no issue:

 var fullName = document.getElementById("full_name");

Task 2 fails and informs me that Task 1 is no longer passing:

 var fullName = document.getElementById("full_name");
 var lastName = document.getElementByClassName('last_name');

This is odd as there doesn't seem to be any difference in the line from one task to the next. Tried some reconfiguring to no avail. Maybe my Task 2 is bad, but then why is it telling me Task 1 won't pass?

1 Answer

Jesus Mendoza
Jesus Mendoza
23,274 Points

Hey Adam,

Try

document.getElementsByClassName('last_name');

and let me know!

Wow. Yes. I didn't have the 's' at the end of 'Elements.' Thanks so much! Amazing that you can stare at the same thing for 20 minutes and not see what's obviously wrong.