How to remove or empty elements in jQuery
July 6, 2010 Category: jQuery TipsRemoving or emptying dom elements with jQuery
// Removes the element from the dom $('selector').remove() // Empties the element $('selector').empty();
Note that this will empty or remove every element matched by the selector, so if you have 25 divs with the class “article-content” and you do $(’div.article-content’).empty(); , It will empty the 25 divs selected.
0 comment
Tags: javascript, jQuery —

