我有许多不同的 div 名称,每个 div 都有相同的 div 具有相同的类名。例子 :
<div class="block1-1">
<div class="block1-11" style="position:relative;overflow:hidden;background:url(images/thumb2.jpg) no-repeat;background-size:cover;">
<div class="caption">
<div class="caption-text"> <a href="#">COAL MINING</a>
<p>PT. Jawon Abadi has several mining development projects in East Kalimantan, South Kalimantan and South Sumatra.</p>
</div>
</div>
<!--<a href="#"><img src="" class="img"/></a>-->
</div>
</div>
<div class="block1-11">
<div class="block1-11" style="position:relative;overflow:hidden;background:url(images/thumb2.jpg) no-repeat;background-size:cover;">
<div class="caption">
<div class="caption-text"> <a href="#">COAL JETTY</a>
<p>Lorem ipsum</p>
</div>
</div>
<!--<a href="#"><img src="" class="img"/></a>-->
</div>
</div>
等等
我想获取.block1-1
或.block1-11
根据.caption
类名。因为我有很多 div,我想最小化 jquery 代码。
请帮忙,谢谢。