且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery选择具有多个类的元素

更新时间:2022-05-04 10:04:16

这应该选择具有两个以上类别的所有元素。

This should select all elements with more than two classes.

$('*').filter(function() {
  return this.className.trim().split(/\s+/).length > 1;
}).foo('bar');