在此HTML中:
<div class="seal">
<div class="how with"> </div>
<div class="how"> </div>
<div class="with"> </div>
</div>
如何选择此嵌套元素?:
<div class="how with"> </div>
答案 0 :(得分:1)
jQuery选择器像CSS选择器一样工作:
$('.seal .how.with')
答案 1 :(得分:1)
<div class="seal">
<div class="how with"> </div>
<div class="how"> </div>
<div class="with"> </div>
</div>
选择器.seal:
var seal = jQuery(".seal");
selector .how
jQuery(".how", seal);
选择.with
jQuery(".with", seal);
selector .how和.with
jQuery(".how.with", seal);
或
jQuery(".seal .how.with");