日期:2014-05-17 浏览次数:20635 次
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> <script type="text/javascript"> function getinnerHTML() { var e=window.document.getElementById("try"); alert(e.innerHTML); } function getouterHTML() { var e=window.document.getElementById("try"); alert(e.outerHTML); } </script> </head> <body> <table width="100%" border="1" cellspacing="0" cellpadding="0" id="try"> <tr> <td>点击下面按钮获得表格的innerHTML各outerHTML</td> </tr> </table> <p> <input type="button" name="Submit2" value="innerHTML" onClick="getinnerHTML()"> <input type="button" name="Submit" value="outerHTML" onClick="getouterHTML()"> </p> </body> </html>