Q:

Set background from value

<table border="1">
    <tr><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td><td><a style="display:none" color="#ff00cc" title="t">t</a><a color="blue" title="asas">a</a></td></tr>
    <tr><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td><td><a style="display:none" color="#6600cc" title="t">t</a><a color="blue" title="asas">a</a></td></tr>
    <tr><td>aaa</td><td>aaa</td><td>aaa</td><td>aaa</td><td><a style="display:none" color="#00ccff" title="t">t</a><a color="blue" title="asas">a</a></td></tr>
</table>

How can i with jQuery set background-color for whole current TR? I must get color from last TD, from selector a (non visible), from parameter color, where title = 't'.
Thanks for help!
http://jsfiddle.net/QaC9w/1/
I would like receive:
http://jsfiddle.net/QaC9w/2/

A:

$('a[title="t"]').each(function() { // the <a> you want to look at
    var tr = $(this).parents('tr'); // the tr of this <a>
    tr.css({
        backgroundColor: $(this).attr('color') // set the color based on the <a>
    });
});​

Fiddle: http://jsfiddle.net/maniator/QaC9w/6/

