获取:
<h2 id="h2">This is an HTML fragment.</h2>
<script type="text/javascript">
$(function () {
layer.msg($("#h2").html());
})
</script>
修改:
<h2 id="h2">This is an HTML fragment.</h2>
<button onclick="changeHtml()">修改HTML</button>
<script type="text/javascript">
function changeHtml() {
$("#h2").html("This is an HTML fragment too.");
}
</script>