Reputation: 12705
I have that div
<div style='width:20px; height:20px; background-color:COLORNAME'></div>
which is created in the for
loop.
Lets say I want to find the div which background color is #0000FF
. How to do it by jquery ?
Upvotes: 0
Views: 49
Reputation: 4349
How about using:
$("[style*='background-color:#0000ff']");
Bear in mind, that it's based on string comparison, so spaces (and case) will matter.
A fiddle: http://jsfiddle.net/eithe/6mwD7/
Upvotes: 3