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 JavaScript and the DOM Making Changes to the DOM Set Inline Styles with the style Property

Golas Makefs
Golas Makefs
Full Stack JavaScript Techdegree Student 285 Points

word "none"

listContainer.style.display === "none"

what is none in here

does none mean for java engine that nothing is in the list = its empty. Is that build in java command.

Can you explain me. How we can do opposite of none?

1 Answer

Steven Parker
Steven Parker
229,981 Points

The "none" in this case is actually a string, and (possibly) the contents of the display style parameter. Setting display to "none" makes the element disappear from the page display (but it still exists in the DOM).

To cancel this effect and make the element visible again, you can just set the display value to an empty string ("") or to some other valid setting (such as "block", for example), or by using the removeAttribute() method as shown in the video.