当前位置: 代码迷 >> HTML/CSS >> innerhtml outerhtml的差异
  详细解决方案

innerhtml outerhtml的差异

热度:836   发布时间:2012-10-16 09:57:37.0
innerhtml outerhtml的区别

<table width= "100% " border= "1 " cellspacing= "0 " cellpadding= "0 " id= "try ">
<tr>
<td> press to get it. </td>
</tr>
</table>

?

对id= "try "而言,

innerhtml: 不包括本身,

<tr> 
 <td> press to get it. </td> 
 </tr>

?

outerhtml:包括本身:

 <table width= "100% " border= "1 " cellspacing= "0 " cellpadding= "0 " id= "try "> 
 <tr> 
 <td> press to get it. </td> 
 </tr> 
</table>