title: How to get a <td> value after clicking the row
body: <p>I want to get the third column in a selected row.</p>
  
  <p>My jQuery is </p>
  
  <pre><code>  $(document).ready(function() {
          $(function() {
              $("#dialog").dialog({
                  autoOpen: false
              });
              $(".tweetButton").on("click", function() {
                  $("#dialog").dialog("open");
              });
          });
  
          $("#submit").click(function() {
              var MyRows = $('table#ForChangingTweet').find('tr').click(function() {
              });
              var MyIndexValue = "hai";
              for (var i = 0; i &lt; MyRows.length; i++) {
                  MyIndexValue = $(MyRows[i]).find('td:eq(2)').html();
  
              }
              alert(MyIndexValue);
          });
      });
  </code></pre>
  
  <p>while my table is </p>
  
  <pre><code>    &lt;table cellspacing="20" class ="tweetTable" id="ForChangingTweet" &gt;
          &lt;caption&gt;Tweets&lt;/caption&gt;
          &lt;% while(rs.next()){ %&gt;
          &lt;tr &gt;
              &lt;td&gt;&lt;%=rs.getString(1)%&gt;&lt;/td&gt;
              &lt;td&gt;&lt;%=rs.getString(2)%&gt;&lt;/td&gt;
              &lt;td&gt;&lt;%=rs.getString(3)%&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="button" class="tweetButton" value="Edit Tweet" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;% } %&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>My program is working fine but the loop in the jQuery is iterating through all value under third column but I want third column value on which I will click the button. In the table every row has a button as I have given the code. When o will click the button then it should give the third <code>&lt;td&gt;</code> of that row and it should alert through <code>alert(MyIndexValue);</code></p>
  
  <p>Can someone tell how I can get that?</p>
  
  <pre><code>&lt;div id="dialog"&gt;
      &lt;form method="post"&gt;
          &lt;label&gt;New Tweet:&lt;/label&gt;
          &lt;input type="text" name="name"&gt;&lt;br/&gt;
          &lt;input type="submit" id="submit" value="Submit" /&gt;&lt;input type="submit" value="Delete" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Above is my dialog box which will open when I will click the 'Edit Tweet' button</p>
  
  <p>Can someone help me to get the answer of this question I got stuck in this. and not getting any solution.</p>