empty() 与 html("") 的区别

 

 

empty,首先循环给后代元素移除绑定、清除jquery给此dom的cache,然后循环removeFirstChild。

 

而html(''),则是简单暴力的设置innerHTML = '';

 

 

查看文章: https://www.cnblogs.com/henryli/archive/2014/02/25/3566461.html

posted @ 2017-12-19 20:32  草木物语  阅读(326)  评论(0编辑  收藏  举报