简体   繁体   English

我们可以找到2个班级吗?

[英]can we .find 2 classes?

I'm wondering what's the best way to achieve this: 我想知道实现此目标的最佳方法是什么:

var $optionSets = $('#options').find('.option-set','#talents')..

That doens't work. 那行不通。

basically i want to say to assign var $optionSets for both .option-set and #talents 基本上我想说的是为.option-set#talents分配var $optionSets #talents

To achieve multiple selections in one "query", seperate your selectors by a comma: 要在一个“查询”中实现多个选择 ,请用逗号分隔选择器:

$('#options').find('.option-set, #talents')

Note: "#talents" is an ID selector, not a class selector 注意:“#talents”是ID选择器,而不是类选择器

DEMO 演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM