Nuriddin Ikramov5,860 Points
The code explanation
I have two questions: 1) Could you explain the conditional statement? I dont understand why I should use if(listDiv.style.display=='none'), as the default value of display is 'block'? Why does it enter the first statement?
Steven Parker187,274 Points
The default value of
style.display is not "block", it's simply an empty string ("").
For some elements (for example, "div") the default display mode is block, but that default is overridden when something is assigned directly to the