I have a large HTML page. Some elements (may be p, h1, div, etc.) are marked with the class "keep_me". Do I need to delete all elements that are present on the page WITHOUT this class? Any idea on how to do this using jQuery?
I tried something like this, but it does not work (obviously;):
jQuery('#content *').remove(":not('[class=keep_me]')");
jquery jquery-selectors
Vincent peres
source share