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筛选元素的主要内容,如果未能解决你的问题,请参考以下文章

jQuery 选择器 -基本选择器-层级选择器-过滤选择器 -元素筛选--->基本语句

jQuery应用 代码片段

jQuery医疗美容项目分类多项筛选菜单代码

使用jQuery筛选排除元素以修改指定标签的属性

JQuery筛选器

jquery 对象的 heightinnerHeightouterHeight 的区别以及DOM 元素的 clientHeightoffsetHeightscrollHeightoffset(代码片段