I'm trying to get the color
attribute value of the first <b>
element inside a <td>
. I'm getting an array object from jquery when I request for:
var items = $("td.yfnc_tabledata1").has("img");
This returns 30 results of <td>
that contain an <img>
tag inside. So my approach is to try and do this inside a for loop:
var color = $(items)[i].find("b").attr("color");
and then count if color === Y || color === X etc etc.
I can't seem to find how to get the color attribute of the first <b>
. The HTML looks like this:
<td>
<img src="" />
<b style="color:#aaa000"> </b>
<b style="color:#aa6700"> </b>
</td>