有谁知道如果元素有任何明确附加到它们的类,我将如何从选择中排除元素?
在这里,我选择了“tdhead”元素中的所有列,但想要排除其中使用另一个类的任何内容,例如,我可能有一个面包屑或工具栏作为顶部的单个列,在tdhead。
_create: function () {
var self = this.element;
var headerColumns = self.children("thead").children("tr").children("td").not(".");
headerColumns.css("background-color", "Red");
}
所以不起作用的是 .not(".") 部分 - 选择(或不选择)具有 any 类的任何内容的正确方法是什么?
最佳答案
.not("[class]")
关于jquery - 如何排除jquery中附加的任何类的元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3421377/