jQuery选择器:逻辑或 [英] jQuery selectors: logical OR

查看:125
本文介绍了jQuery选择器:逻辑或的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在看不到树的森林(已经看过api文档)。

它与jQuery选择器有关:我想要做的是选择所有具有类 subtitle headection 的元素。像这样: $('。headsection || .subtitle');

I can't seem to see the forest for the trees right now (Looked at the api docs already).
It has to do with jQuery selectors: What I'm trying to do is to select all elements that have class subtitle or headsection. Something like this: $('.headsection || .subtitle');

要使用此函数 nextUntil

$content = $some_elements.eq(0).nextUntil('.headsection || subtitle');

据我所知 || 不适用于jQuery的选择器。那么最好的方法是什么呢?

As far as I know || is not available in jQuery's selectors. So what's the best way to accomplish that?

感谢您的帮助!

推荐答案

关于: $ some_elements.eq(0).nextUntil('。headsection,.subtitle');

至少适合我。阅读多个选择器

这篇关于jQuery选择器:逻辑或的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆