運行沒結果?
運行沒結果?
?<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
因為你設置的變量是count ,但是你寫document.write(node[i].nodeName);的時候用的是node [i],應該改回?? 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>