for (i = 0; i < lis.length; i++) {
o = document.getElementById("d" + i );试试

解决方案 »

  1.   

    参考: Plain Text vs innerText vs textContent
    不用管document.allfunction innerText(node) {
        return node.textContent || node.innerText;
    }
      

  2.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    window.onload=function(){
    function innerText(o) {
    return document.all ? o.innerText : o.textContent;
    }
    alert(innerText(document.getElementById('test')));
    }
    </script>
    </head><body>
    <div id="test">123</div>
    </body>
    </html>没问题阿