jQuery根据style筛选元素
Posted yanan7890
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery根据style筛选元素相关的知识,希望对你有一定的参考价值。
<div style="display:block;"> <input/> </div> <div style="display:none;"> <input/> </div>
如上的两个input元素,获取两个input元素,常规的按index、id或判断等形式也能实现,但是很麻烦,可以用以下办法
$(".div[style=‘display:block;‘] input")
注意“;”分号不能省略
以上是关于jQuery根据style筛选元素的主要内容,如果未能解决你的问题,请参考以下文章