Possible Duplicate:
Why does $('#table > tr') selector not match? (always return 0)
I tried to apply color to rows of a table using the following code. It doesn't work, but I don't understand why. Could someone explain why or point me in the right direction?
HTML:
<table id="tblSample" border="1" cellpadding="0" cellspacing="0" width="300px">
<tr>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>2</td>
<td>2</td>
</tr>
</table>
JQuery:
$("#tblSample > tr").css("background-color", "gray");