首页 > 代码库 > javascript for循环

javascript for循环

<script language="javascript">
a = document.getElementsByTagName("div");
alert(a.length);
for(i=0,j=0;i<a.length;i=i+1)
{
alert(a[i].id + ":" + a[i].innerHTML);
}

</script>

javascript for循环