I have two divs:
<div class="dialog large"></div>
and
<div class="dialog"></div>
I have to remove the one with the class “dialog” but keep the one with “dialog large”.
If I do $('dialog').remove(); they are both removed.
Can anyone help me with this?
DEMO
A little explain
div.dialogwill selectdivwithclass=dialog(in this case both div will select). Butdiv.dialog:not(.large)will exclude thosedivwithclasslargeand remove them.Related Refs
:not()
class selector