I want to make a menu in two lines, for this I need to count the number of ul elements, which function in javascript is responsible for this? I tried something like this:
<ul> <li>Главная</li> <li>Контакты</li> <li>Резюме</li> <li>Портфолио</li> <li>Услуги</li> <li>Стихи</li> <li>Программы</li> <li>Статьи</li> </ul> <script> var spis = document.ul.li.length; document.write('Кол-во элементов ul '+spis); </script>
The script should count the number of li and after every 4th, transfer the rest to the next line.