title: jQuery not executing onClick for a class of buttons
body: <p>Javascript:</p>
  
  <pre><code>    &lt;script&gt;
          $(document).ready(function(){//So far AJAX isn't asyncn.
              $(".acceptorbutton").on('click', function(){
                      var whichClicked = this.attr('name');
                      var cat = parseInt(whichClicked, 10);
                      alert("this text is not appearing");
                      $.ajax({
                          type:"POST",
                          url:"getuser.php",
                          data: {friendadd : cat},
                          success: function(){
                              alert("Ajax success");
                          }
                      })
              })
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>PHP and HTML Form: It is looping through for every user that the search result turns up. Next to each user is an input button that onClick should call getuser.php. The Input buttons are identical except for they're names. On the click, the jQuery should execute yet it does not detect it.</p>
  
  <pre><code>            &lt;form id="friendadd" enctype="multipart/form-data"&gt;
      &lt;?php
          for($i=0; $i&lt;$ctk-&gt;rowCount(); $i++){
              echo "&lt;img src='".$ctk_values[$i][6]."' alt='Blank' style='width:64px;height:64px'&gt;";//PP, Later add clickable profile
              echo "&lt;th rowspan='3'&gt;Attributes&lt;/th&gt;";
              echo "&lt;tr&gt;  ".$ctk_values[$i][0]."&lt;/tr&gt;";//UN
              echo "&lt;tr&gt;  ".$ctk_values[$i][1]."&lt;/tr&gt;";//UL
              echo "&lt;tr&gt;  ".$ctk_values[$i][5]."&lt;/tr&gt;";//UA
              echo "YOYOYOO".$ctk_values[$i][4];
              $GlobalAcceptorId=$ctk_values[$i][4];
      ?&gt;
  
      &lt;div id="dom-target" style="background-color:yellow;"&gt;
          &lt;?php
              echo $GlobalAcceptorId;
          ?&gt;
      &lt;/div&gt;
                  &lt;input class="acceptorbutton" type="button" name="&lt;?php echo $ctk_values[$i][4];?&gt;"&gt;&lt;br&gt;
      &lt;?php   
          }//Ends for loop
      ?&gt;
              &lt;/form&gt;     
      &lt;?php
              }
          }
      ?&gt;
  </code></pre>
  
  <p>What I've tried so far: the alert box isn't appearing. I've tried changing the form button type to submit and made the Javascript <code>$(".acceptorbutton").submit(function(){....</code></p>
  
  <p>Thanks in advance! Please let me know if you need more information but so far I don't think I'm missing any critical data.</p>