title: get the closest textbox in same table
body: <p>I have the following controls in the same table.</p>
  
  <pre><code>&lt;td&gt;
       &lt;asp:TextBox ID="tbOwnerSearchField" Text="Search..." ClientIDMode="Static"  runat="server"&gt;&lt;/asp:TextBox&gt;
  &lt;/td&gt;
  
  &lt;td&gt;
       &lt;input type="button" id="btnSearch" data-field="tbOwnerSearchField" value="Search" /&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>I currently use a data attribute of the button element to store the textbox id like this:</p>
  
  <pre><code>data-field="tbOwnerSearchField"
  </code></pre>
  
  <p>I then reference that textbox in my jQuery methods like this:</p>
  
  <pre><code>var searchField = $(this).data("field");
  var searchTerm = $("#" + searchField).val();
  </code></pre>
  
  <p>To me, my code seems convoluted...Is there a better way of doing this?</p>
  
  <p>Thanks</p>