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>

你可能感兴趣的:(innerHTML)