jQuery trouble with .remove()
<p>I am making an inline comment reply system</p>

<p>It's mostly working except that I cannot seem to apply a .remove() to the DIV's created by my reply link - to "cancel" the reply</p>

<p>My jQuery code is:</p>

<pre><code>    &lt;script type="text/javascript"&gt;
    $(function() {
        &lt;!-- jQuery inline replies --&gt;
        $("a.reply_link").click(function(){
            this_id = this.id;
            $("#reply_link_div" + this_id).after('&lt;div id="reply_div' + this_id + '" class="reply_div"&gt;&lt;form method="post" action="&lt;?php echo SITE_URL . "/comment"; ?&gt;"&gt;'+
                                                 '&lt;input type="hidden" name="post_id" value="&lt;?php echo $view[0]['id']; ?&gt;" /&gt;'+
                                                 '&lt;input type="hidden" name="post_slug" value="&lt;?php echo $_REQUEST['post']; ?&gt;" /&gt;'+
                                                 '&lt;input type="hidden" name="comment_thread" value="' + this_id + '" /&gt;'+
                                                 '&lt;strong&gt;reply&lt;/strong&gt;&lt;div style="padding-bottom:4px;"&gt;'+
                                                 '&lt;textarea name="comment_text" id="comment_text' + this_id + '" rows="1" style="width:100%;" /&gt;&lt;/textarea&gt;'+
                                                 '&lt;/div&gt;&lt;input type="submit" name="submit" value="submit" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="#" class="reply_cancel_link" id="' + this_id + '"&gt;cancel&lt;/a&gt;&lt;/form&gt;&lt;/div&gt;')
            $("#reply_link_div" + this_id).hide();
            return false;
        });

        &lt;!-- jQuery reply cancel --&gt;
        $('a.reply_cancel_link').click(function() {
            this_id = this.id;
            $('#reply_div' + this_id).remove();
            $("#reply_link_div" + this_id).show();
            return false;
        });
    });
    &lt;/script&gt;
</code></pre>

<p>My HTML/PHP code is:</p>

<pre><code>&lt;table class="comment_table"&gt;
    &lt;tr class="comment_text_outer_tr"&gt;&lt;td colspan="4" class="comment_text_td"&gt;Comment text blah blah
    &lt;div id="reply_link_div&lt;?php echo $comment_id; ?&gt;"&gt;&lt;a href="#" id="&lt;?php echo $comment_id ?&gt;" class="reply_link" style="float:right;"&gt;reply&lt;/a&gt;&lt;/div&gt;
    &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>When the user clicks the "reply" text, jQuery draws a reply_div underneath, inside this div is a link to "cancel" the reply</p>

<p>When the user clicks the cancel link, it should run the code under "jQuery reply cancel", which is supposed to .remove() the associated reply_div</p>

<p>When I click cancel, nothing happens and there are no errors</p>

<p>Can you see what's wrong with my code? Thanks</p>
