Task 1. Every second in the visible area appear squares with the corresponding numbers. Task 2. When the number 5 appears, everything starts over.
setTimeout(function (){ var block = document.getElementsByTagName('li'); for(i=0; i < block[i].length; i++) { block[0].style.display = 'block'; } i++; },1000) ul { border: 1px solid #000; width: 50px; height: 50px; padding-left: 0; } li { width: 50px; height: 50px; border: 1px solid #000; text-align: center; list-style-type: none; display: none; } <ul> <li class="block">1</li> <li class="block">2</li> <li class="block">3</li> <li class="block">4</li> <li class="block">5</li> </ul>
i. If it is assumed that it exists,block[i]returns an HTML element, and the HTML element does not have alengthproperty. - andreymal