Remove and Empty Elements in jQuery — a practical guide to jQuery remove empty with clear examples you can reuse in real projects.
jQuery Tutorial Series (45/101). Prefer one article? Read the complete jQuery tutorial.
Short description
detach() removes but keeps data/events for reinsertion.
remove empty detach
$('#note').remove();
$('#list').empty();
var $tmp = $('#widget').detach();