例如,我想选择每个具有红色背景颜色的 div。
这在 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>
谢谢
这段代码也适用于 CSSnot在标签的 style 属性中定义:
$('div').filter(function() {
return $(this).css('background-color') == 'red';
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)