Does anyone know how i'd exclude elements from a selection if they have any class whatsoever explicitly attached to them?
Here i'm selecting all columns within the 'tdhead' element, but want to exclude anything I have ther开发者_运维百科e that's making use of another class, for example I might have a breadcrumb or toolbar as a single column across the top, in the tdhead.
_create: function () {
var self = this.element;
var headerColumns = self.children("thead").children("tr").children("td").not(".");
headerColumns.css("background-color", "Red");
}
So what's not working is the .not(".") part - whats the correct way to select (or not select) anything with any class?
.not("[class]")
var headerColumns = self.children("thead").find("td").not(".someClass1, .someClass2");
this will get all td
's except those with class someClass1
or someClass2
. Any question?
精彩评论