Insert a html code on clicking a link using jquery method insertBefore
<p>I am developing a social website like facebook in php. I have a page for displaying the messages for the user with two links,that is <code>reply</code> and <code>delete</code> at the right bottom corner for every messages in the inbox. My issue is that when i click the reply link another html block should come where user can send the responses back to the sender.I have written the code like this</p>

<pre><code>&lt;div class="msgutil"&gt;
   &lt;a href="" id="reply" onclick="return post_reply()" &gt;reply&lt;/a&gt;//this method does'nt works

   &lt;a href="delete_message.php?msg_id=&lt;?php echo $row_msg_id;?&gt;"&gt;delete&lt;/a&gt; //dont check this
&lt;/div&gt;&lt;!--end msgutil--&gt;
</code></pre>

<p>I have inserted the html document inside the post_reply() like this</p>

<pre><code>  &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;
 &lt;/script&gt;

&lt;script type="text/javascript"&gt;
function post_reply()
 {
    $("&lt;form id="msgreply" name="msgreply" action="#"&gt; &lt;textarea name="replyfield"    id="replyfield"&gt;&lt;/textarea&gt; &lt;/form&gt;").insertBefore("#reply");
return true;
 }
 &lt;/script&gt;
</code></pre>

<p>I don't know why its not working.</p>
