jQuery Remove tr after ajax success
<p>I am trying to remove table row after successful ajax call, but it is not working. No errors in firebug, it deletes the row on the back-end PHP, just doesnt remove the tr. Here is my code:</p>

<pre><code>function closelead(rowid){
            var rowid = rowid;

            $.ajax({
                type: "POST",
                url: "ajax/close.php",
                data: "rowid="+ rowid,

                success: function(html){

                    $(this).closest('tr').remove();
                }
            });

            }
</code></pre>

<p>and the html:</p>

<pre><code>&lt;table  id="companytable"&gt;
        &lt;tr id="top"&gt;&lt;th&gt;Business Name&lt;/th&gt;&lt;th&gt;Phone&lt;/th&gt;&lt;th&gt;Carrier&lt;/th&gt;&lt;th&gt;X-Date&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;&lt;/th&gt;&lt;/tr&gt;
        &lt;?php
        $query =   "SELECT * FROM leads WHERE user = '$user' ORDER BY wccompcode";
         $selectlead = mysql_query($query)or die(mysql_error());
         while($leadlist = mysql_fetch_array($selectlead)){
            $compcode = $leadlist['wccompcode'];
            $compcode = sprintf("%03s", $compcode);
            $selcomp = mysql_query("SELECT carname FROM carrierlist WHERE carcode = '$compcode'")or die(mysql_error());

            while($carrier = mysql_fetch_array($selcomp)){
                $carrier1 = $carrier['carname'];
            }
            ?&gt;
            &lt;tr id="&lt;?php echo $leadlist['ID'];?&gt;"&gt;&lt;td id="busname"&gt;&lt;?php echo $leadlist['busname'];?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo $leadlist['phone'];?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo $carrier1;?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo date("m/d/Y",strtotime($leadlist['wcxdate']));?&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="button" value="Call Back" class="searchbutton" /&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="button" onclick="closelead(&lt;?php echo $leadlist['ID'];?&gt;)" value="Close" class="searchbutton" /&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="button" value="Soft Quote" class="searchbutton" /&gt;&lt;/td&gt;&lt;/tr&gt;
            &lt;?
         }
        ?&gt;
        &lt;/table&gt;
</code></pre>
