Background color of tr is not changing using jquery <p>I would like to change the background olor of a tr while clicking on its child td.I cant add <code>onclick</code> to tr since it is dynamically generating from a gridview control of asp.net after rendering.</p> <p>my mark up is</p> <pre><code>&lt;tbody&gt; &lt;tr&gt; &lt;td style="width:27%;"&gt;&lt;span onclick="SelectAddressRow(this)"&gt;Ajish&lt;/span&gt;&lt;/td&gt; &lt;td style="width:40%;"&gt;&lt;span onclick="SelectAddressRow(this)"&gt;22&lt;/span&gt;&lt;/td&gt; &lt;td style="width:33%;"&gt;&lt;span onclick="SelectAddressRow(this)"&gt;Male&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; </code></pre> <p>my code is </p> <pre><code>function SelectAddressRow(column) { var tableRow=$(column).parent(); $(tableRow).parent().css({ "background-color": "#B3B3B3" }); } </code></pre> <p>but it is not working,But it affects for a td if the statement is replaced by</p> <pre><code>$(tableRow).css({ "background-color": "#B3B3B3" }); </code></pre>