Can't get jQuery's .replaceWith() to work?
<p>Basically I am trying to have jQuery replace the button with the form and status div once clicked. </p>

<p>I am new to jQuery and hardly an advanced programmer so I am sure the solution will be relatively simple. On the other hand I am at my wits end with this issue and any help would be <em>greatly</em> appreciated. Thank you.</p>

<p>EDIT: Solution found. Interestingly enough it also only worked when I put it in a separate .js file and referenced it, <em>not</em> when I had it within  tags on the php page. Thanks again to everyone who responded!</p>

<hr>

<pre><code>$(document).ready(function() { 
   $("#repbutton").click(function() {
   $("#repbutton").replaceWith("&lt;form id=\"reputation_form\" method=\"post\"&gt;
    Give positive reputation to &lt;?=$reply_user['username']?&gt; for their reply?
    Comment: &lt;input type=\"text\" name=\"comment\" id=\"comment\" /&gt; 
             &lt;input type=\"hidden\" id=\"uid\" value=\"&lt;?=$reply_user['id']?&gt;\"&gt;
             &lt;input type=\"hidden\" id=\"rid\" value=\"&lt;?=$replies_row['id']?&gt;\"&gt;
             &lt;input type=\"hidden\" id=\"urid\" value=\"&lt;?=$user_row['id']?&gt;\"&gt;
             &lt;input type=\"submit\" value=\"Give Reputation\" /&gt;
&lt;/form&gt;
&lt;div id=\"status\"&gt;
        &lt;p&gt;&lt;/p&gt;
    &lt;/div&gt;"); 

    });
   });
</code></pre>
