Ticket #4004 (closed enhancement: fixed)
Speed up DOM removal by decoupling event.remove and removeData
|Reported by:||tr4nslator||Owned by:|
(as discussed here on jQuery dev)
All jQuery operations that remove DOM nodes (including $.fn.replaceWith, $.fn.empty, $.fn.html, and $.fn.text) use $.fn.remove internally to centralize processing for removing events and expando data.
Many of these methods could be made faster by decoupling element death from DOM removal: once elements are killed, they could be replaced using the fastest method: Node.prototype.innerHTML for $.fn.empty, and Node.prototype.replaceChild for $.fn.replaceWith (which is 20% faster than the current method of appending and then removing).