jQuery-选择具有特定样式的子项 [英] jQuery - select children which has specific styles
本文介绍了jQuery-选择具有特定样式的子项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在下面的示例中,我不知道如何选择第一个跨度.
I do not know how to select the first span in the following example.
<div class="sp">
<span style="visibility:hidden">abc</span>
<span>xyz</span>
</div>
我尝试过使用它,但是没有用.
I have tried using this one, did not work.
$('div.sp span[visibility=hidden]') // not work
谢谢!
推荐答案
$('div.sp span[style="visibility:hidden"]')
请参见属性等于选择器
这篇关于jQuery-选择具有特定样式的子项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文