【发布时间】:2016-11-15 18:25:42
【问题描述】:
我正在尝试通过 jquery 制作选项卡过滤器。 我想问如何选择只有div有类type1也有类type2
<div class="type1 type2"> </div> //select this one
<div class="type1 type4"> </div>
如果找到,检查选择器长度
var typeselect = $('select the div above');
if(typeselect.length > 0 ){} found it
else
【问题讨论】:
-
$('.type1.type2') -
阅读所有 jQuery 选择器here