<ul id="ul"> <li>1</li> <li>2</li> </ul> <script> var li = document.getElementById('ul').children, i = li.length; while(i--) { li[i].style.color = 'red'; } </script>