For example if I have a link with the following event bound to it:
$("a.d").bind("click", this, onDelete);
And later do:
$("a.d").remove();
Is that fine? Or does it cause a memory leak and I need to call unbind 1st?
Thanks for any help.
From jQuery docs for remove()
Removes all matched elements from the DOM. This does NOT remove them from the jQuery object, allowing you to use the matched elements further. Note that this function starting with 1.2.2 will also remove all event handlers and internally cached data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With