<script> var arr=new Array(); var list=""; for (var i=0;i<arr.length;i++) { list +="<li>"+arr[i]+"</li>"; } document.getElementById('test').innerHTML = list; </script> <ul id='test'></ul>