jquery元素通过css过滤 [英] jquery element filter by css
本文介绍了jquery元素通过css过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,我想选择具有红色背景色的每个div. 在jquery中有可能吗?
I would like to select every div that has a red background color for example. is this possible in jquery?
<div style="background-color:red"></div>
<div style="background-color:white"></div>
<div style="background-color:red"></div>
<div style="background-color:yellow"></div>
谢谢
推荐答案
$('div[style=background-color:red]');
这篇关于jquery元素通过css过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文