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

JavaScript DOM Scripting By Example Editing and Filtering Names Filter Invitees Who Have Not Responded

Vladimir Plokhotniuk
Vladimir Plokhotniuk
5,464 Points

how to see what class attributes we have?

...because i cannot imagine from which place we received a data in our key (main) function of this lesson.

1 Answer

Steven Parker
Steven Parker
229,732 Points

The ".className" property of an element will contain all the class names assigned to that element. Is that what you were asking in the first question?

But I don't quite understand the 2nd question, could you rephrase and/or elaborate a bit?

Vladimir Plokhotniuk
Vladimir Plokhotniuk
5,464 Points

Yes, sorry, but where is this class names, assigned to that element? When i wrote " li.className " in console.log, i dont see nothing. second is about this function: if (li.className === 'responded') { li.style.display = ' '; } else { li.style.display = 'none'; } Thanks.

Steven Parker
Steven Parker
229,732 Points

I can't be sure without seeing the whole code, but perhaps the element doesn't have any class name(s) assigned to it, and so the property is empty.