title: JQuery/Javascript my function is not running when pressing button
body: <p>I have a button, when I click I want it to get all data from the row. My .php file (i also have php code not included here) looks like so (I trimmed out the table for stackoverflow)</p>
  
  <pre><code>&lt;tr class='rowdata'&gt;
       &lt;td&gt;Bob&lt;/thd&gt;
  &lt;/tr&gt;
  
  &lt;input type='submit' class='getRow' value='ClickMe'&gt;
  
  &lt;script&gt;
      $(".getRow").click(function() {
         var rowOfData = $(this).closest(".rowdata");
         alert(rowOfData.text());
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Right now I click and nothing happens. Any ideas? The . prefix means it is searching for class.</p>