摘要:
首先来看一段代码:<script type="text/javascript">function xc(){var ul1 = document.getElementById('ul1').getElementsByTagName('li');for(var i=0;i<ul1.length;i++){ul1[i].onclick=function(){alert(i);}}}window.onload = xc;</script><ul id="ul1"> <li>1 阅读全文