jQuery not replacing html button with text for more than 1 user
<p>I have this piece of code written in jQuery and PHP:</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function(){
  $(".vote&lt;?php echo $pid; ?&gt;").click(function(){
  $("span.vote_box&lt;?php echo $pid; ?&gt;").html("you have voted");
  });
});
&lt;/script&gt;
</code></pre>

<p>But it doesn't seem to work. What it is supposed to do is to print "you have voted" in the position of a button which users can use to vote some post with. It reacts ok in the beginning but when i log on as a different user the button stays intact and doesn't get replaced.</p>

<p>Here is the PHP and HTML part:</p>

<pre><code>&lt;?php
echo '&lt;span class="vote_box'.$pid.'"&gt;';
echo '&lt;input type="button" class="vote'.$pid.'" name="vote" value="vote"/&gt;';
echo '&lt;/span&gt;';
?&gt;
</code></pre>

<p>NOTE: I am using an AJAX request to insert the vote to the database so practically all I want jQuery to do is replace the button with text</p>

<p>Any help? I am new to jQuery so I figure the "html" method I am using could be wrong. Thanks in advance!</p>
