解决-innerHTML无法在TBODY中使用

<html>   
    <head>   
      <SCRIPT   language=javascript>   
        function   doSomething(){   
          tbody   =   document.all.item("test");   
  tbody.parentNode.outerHTML   =   tbody.parentNode.outerHTML.replace(tbody.innerHTML,"<tr><td>ab</td><td>ok</td></tr>");   
                  
        }   
      </SCRIPT>   
      </head>   
    <body   onload=doSomething()>   
      <table>   
<tr><td>123</td><td>12<td></tr>
      <TBODY   id="test">   
        <tr>   
            <td>测试</td>   
            <td>不成功</td>   
        </tr>   
      </TBODY>   
    </table>   
    </body>   
  </html>

 

你可能感兴趣的:(JavaScript,html)