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
174,163 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
174,163 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.