我想像这样在div内选择一个 anchor
<div class="response content">
Disapproved Bank Mandiri<br><br>
<p>
<a class="showlist" href="#">Back to list?</a>
</p>
</div>
什么是jquery来做到这一点?
最佳答案
div 中具有“响应”和“内容”类的任何 anchor :
$('.response.content a')
或者仅具有“showlist”类的 anchor :
$('.response.content a.showlist')
关于jquery 在类中选择元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2672532/