将多个选择器与过滤器组合

Kei*_*Kei 3 jquery

有没有办法在单个查询中组合多选择器和基本过滤器?

例如...

var jq = $(someElement);

// Want to find the first following sibling node which has either classA or classB.

// This imaginary jquery does not quite work.
jq.nextAll("(.classA, .classB):first") 

// This works. But I wonder if I can achieve the same result with just one query.
jq.nextAll(".classA, classB)").filter(":first")
Run Code Online (Sandbox Code Playgroud)

Tar*_*asB 5

怎么样.first()而不是.filter(":first")

这有帮助吗?