Bold table row using Jquery
<p>I am tring to bold the row of a table when click.
What shall I do to let the script know which row I click? 
The only way I can think of is using function as below.</p>

<pre><code>&lt;script&gt;
function bold(x){
    $("#"+x).click(function(e){ 
        $(this).css("font-weight","bold");
        e.stopPropagation(); 
       });
   }
&lt;/script&gt;
&lt;table&gt;
&lt;tr id = 1 onclick = bold(this.id)&gt;&lt;td&gt;A&lt;/td&gt;&lt;/tr&gt;
&lt;tr id = 2 onclick = bold(this.id)&gt;&lt;td&gt;B&lt;/td&gt;&lt;/tr&gt;
&lt;tr id = 3 onclick = bold(this.id)&gt;&lt;td&gt;C&lt;/td&gt;&lt;/tr&gt;
&lt;tr id = 4 onclick = bold(this.id)&gt;&lt;td&gt;D&lt;/td&gt;&lt;/tr&gt;
&lt;tr id = 5 onclick = bold(this.id)&gt;&lt;td&gt;E&lt;/td&gt;&lt;/tr&gt;
&lt;tr id = 6 onclick = bold(this.id)&gt;&lt;td&gt;F&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>Is there any better way to do it without using function?</p>
