我試圖通過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選擇器[這裏](https://api.jquery.com/category/selectors/) –