change the background color
<p>hi 
   this code expalins to the dynamcically add and deletind the rows,
  if i select the row ,it sholud be change this background color can please help me
thanks</p>

<p>
    
        Dynamic Creation
        
        </p>

<pre><code>$(document).ready(function() {

            $("&lt;table class='table1' border='1'&gt;&lt;/table&gt;").appendTo(".div1");

            $(".add").click(function() {
                addRows();
            });
            $(".delete").click(function() {
                deleteRows();
            });
            function addRows() {
                $tab = $(".table1");
                $("&lt;tr class='raja'&gt;&lt;td&gt;rajasekhar&lt;/td&gt;&lt;td&gt;hostanalytics&lt;/td&gt;&lt;/tr&gt;").appendTo($tab);
                $(".raja").click(function() {
                $tab.removeClass("selected");
                $(this).addClass("selected");
                });
            }
            function deleteRows() {
                $(".selected").remove();
            }
         });
        &lt;/script&gt;

&lt;/head&gt;
&lt;body&gt;
    &lt;div class="div1"&gt;
        &lt;/div&gt;
    &lt;input type="button" class="add" value="InsertRow" /&gt;
    &lt;input type="button" class="delete" value="DeleteRow" /&gt;
&lt;/body&gt;
</code></pre>

<p></p>
