innerHTML、outerHTML、innerText、outerText的区别

运行以下代码仔细观看一下结果就知道它们的区别了!
<div id="div"><input name="button" value="Button" type="button"><font color="green"><h2>This is a DIV!</h2></font></div>
<input name="innerHTML" value="innerHTML" type="button" onClick="alert(div.innerHTML);">
<input name="outerHTML" value="outerHTML" type="button" onClick="alert(div.outerHTML);">
<input name="innerText" value="innerText" type="button" onClick="alert(div.innerText);">
<input name="outerText" value="outerText" type="button" onClick="alert(div.outerText);">
posted @ 2008-08-10 00:42  CrystalPipe  阅读(250)  评论(0编辑  收藏  举报