jQuery中.html(“xxx”)和.append("xxx") 的区别
append是追加,html是完全替换
比如<p id="1"><p>123</p></p>
$("#1").html("<span>456</span>");
结果是:<p id="1"><span>456</span></p>
$("#1").append("<span>456</span>");
结果是:<p id="1"><p>123</p><span>456</span></p>
append是追加,html是完全替换
比如<p id="1"><p>123</p></p>
$("#1").html("<span>456</span>");
结果是:<p id="1"><span>456</span></p>
$("#1").append("<span>456</span>");
结果是:<p id="1"><p>123</p><span>456</span></p>