運(yùn)行沒結(jié)果?
運(yùn)行沒結(jié)果?
?<script type="text/javascript">
? ? var count=0;
? ? var node=document.getElementsByTagName("li");
? ? for(count=0;count<node.length;count++)
? ? {
? ? ? ? document.write(node[i].nodeName);
? ? ? ? document.write(node[i].nodeValue);
? ? ? ? document.write(node[i].nodeType);
? ? }
? ??
? </script>
2017-02-06
因?yàn)槟阍O(shè)置的變量是count ,但是你寫document.write(node[i].nodeName);的時(shí)候用的是node [i],應(yīng)該改回?? node [count]
2017-02-06
?<script type="text/javascript">
? ? var count=0;
? ? var node=document.getElementsByTagName("li");
? ? for(i=0;i<node.length;i++)
? ? {
? ? ? ? document.write(node[i].nodeName);
? ? ? ? document.write(node[i].nodeValue);
? ? ? ? document.write(node[i].nodeType);
? ? }
? ??
? </script>