<label id="mybox">A</label>
<button onclick="document.getElementById('mybox').innerText='B';alert(document.documentElement.outerHTML)">修改</button>
<button onclick="document.getElementById('mybox').innerText='B';alert(document.documentElement.outerHTML)">修改</button>
或者document.getElementById('mybox').outHTML
得到的就是id为'mybox'的对象的html代码
<button onclick="document.getElementById('mybox').innerText='B';alert(document.getElementById('mybox').outerHTML)">修改</button>