我测试的浏览器是'Firefox/3.0.6', IE 6.0两个。IE6.0 支持所有的属性,Firefox/3.0.6只支持innerHTML,其余几个都提示 'undefined'

innerHTML 设置或获取位于对象起始和结束标签内的 HTML

outerHTML 设置或获取对象及其内容的 HTML 形式

innerText 设置或获取位于对象起始和结束标签内的文本

outerText 设置(包括标签)或获取(不包括标签)对象的文本

 

Code

InnerHTML 按钮输出: Testing the outerHTML Content <SPAN id="second"> and innerHTML Content</span>

outerHTML 按钮输出: <DIV id="first">Testing the outerHTML Content <SPAN id="second"> and innerHTML Content</SPAN></DIV>

innerText 按钮输出: Testing the outerHTML Content and innerHTML Content

outerText 按钮输出: Testing the outerHTML Content and innerHTML Content

 

second InnerHTML 按钮输出: and innerHTML Content

second outerHTML 按钮输出: <SPAN id="second"> and innerHTML Content</SPAN>

second innerText 按钮输出: and innerHTML Content

second outerText 按钮输出: and innerHTML Content