Reputation: 9388
I have a asp.net Listview that is generating extra elements, good thing is the elements that I do want have a class name. How do I remove the s without the specific class that i need in jquery thanks!
Upvotes: 1
Views: 479
Reputation: 6623
Use the :not
selector:
$("div:not([class])").remove();
Edit: jsfiddle.
Upvotes: 5
Reputation: 44215
class is just an attribute so you can select each one that doesn't have the attribute:
$('div:not([class])').remove()
Upvotes: 2