title: jQuery find all elements with specific class
body: <p>I'm using jQuery AJAX to implement a voting system. I'm using this code:</p>
  
  <pre><code>$(".vote_up").click(function(){
      var target = $(this);
      var id = this.id;
      var vote = $(this).attr("class");
      var voteCount = $(this).next('p').attr("class");
      var data = "id=" + id + "&amp;vote=" + vote;
      $.ajax
          ({
              context: this,
              type: "POST",
              url: "vote.php",
              data: data,
              dataType: "json",
              cache: false,
              success: function(data)
              {
                  target.attr('disabled','disabled');
                  for(var x in data) {
                          $("." + voteCount).html(data[x].vote_up);
                  }
              }
      });
  });
  </code></pre>
  
  <p>I have is an input and a corresponding <code>&lt;p&gt;</code> element via this code:</p>
  
  <pre><code>while ($row = mysql_fetch_array($result)){
      echo "&lt;p&gt;" . $row['content'] . "&lt;/p&gt;";
      echo "&lt;p&gt;Posted by " . $row['username'] . "&lt;/p&gt;";
      if($_SESSION['username']){ 
          echo "&lt;input type='button' id='".$row['id']."' class='vote_up' value='vote up'&gt;&lt;/input&gt;";
      }
      echo "&lt;p class='votes_up ".$row['id']."'&gt;" . $row['vote_up'] . "&lt;/p&gt;";
      if($_SESSION['username']){ 
          echo "&lt;input type='button' id='".$row['id']."' class='vote_down' value='vote down'&gt;&lt;/input&gt;";
      }
      echo "&lt;p class='votes_down ".$row['id']."'&gt;" . $row['vote_down'] . "&lt;/p&gt;";
      echo "&lt;hr /&gt;";
  }
  </code></pre>
  
  <p>When the user presses on a vote_up or vote_down button for the jQuery success function, it should update all <code>&lt;p&gt;</code> elements on the page with their class name as the same as the input button's ID. For example, if input was pressed with ID 12, then there will be 5 <code>&lt;p&gt;</code> elements with class name of 12. </p>