<p><div id="div" style="background-color:#ff9966;border:1px #ff0000 dashed;"><span>This is a layer</span></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);">
<script language="javascript">
function changeb(obj)
{
obj.outerHTML = "<input type='text' value='Set the HTML within the object, including tags' style='width:200px;'></input>"
}
function changea(obj)
{
obj.innerHTML = "<b>Set the HTML within the object</b>"
}
</script>
<br><br>
innerHTML gets the HTML within the tag<br>
outerHTML gets the tag and the HTML within the tag<br>
innerTEXT and outerTEXT both get the text within the label, which is the same. <br>
<br><br>
<div id="div1" style="background-color:#ff9966;border:1px #ff0000 dashed;">This is a layer</div>
<br>
<input name="innerHTML1" value="innerHTML" type="button" OnClick="changea(div1)">
<input name="outerHTML1" value="outerHTML" type="button" OnClick="changeb(div1)">
<input name="innerText1" value="innerText" type="button" OnClick="div1.innerText='Replace text with innerText'">
<input name="outerText1" value="outerText" type="button" OnClick="div1.outerText='Using outerText will replace the label with the target text, and the layer will also be replaced'">
<br>
<p>
innerHTML sets the HTML within the tag<br>
outerHTML sets the tag and the HTML within the tag<br>
innerTEXT sets the text within the label<br>
innerTEXT sets the text within the label, including the label, and replaces it together. <br>
</p>
innerHTML sets or gets the HTML located within the opening and closing tags of the object <br>
outerHTML sets or gets the HTML form of the object and its content<br>
innerText sets or gets the text located within the start and end tags of the object<br>
outerText sets (including labels) or gets (excluding labels) the text of the object<br><br>