title: get input values inside a table td
body: <p>I have table with a button as following; I'm trying to get the values of td's using jQuery. </p>
  
  <p>My table:</p>
  
  <pre><code>&lt;table class="table" id="Tablesample"&gt;
  
      &lt;tr&gt;
          &lt;th style="display:none;"&gt;
              @Html.DisplayNameFor(model =&gt; model.Id)
          &lt;/th&gt;
  
      &lt;/tr&gt;
  
      @foreach (var item in Model)
      {
          &lt;tr&gt;
              &lt;td style="display:none;" class="keyvalue"&gt;
                  &lt;input type="text" name="Key" value="@item.Key" class="form-control" id="configKey" readonly="readonly"&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="Key" value="@item.Id" class="form-control" id="configId" readonly="readonly"&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  
      }
  
  &lt;/table&gt;
  
  &lt;button id="btnSave"&gt;Save&lt;/button&gt;
  </code></pre>
  
  <p>then I'm trying to get the value using jquery:</p>
  
  <pre><code>$('#btnSave').click(function () {
  
      $('#Tablesample tr').each(function () {
  
          var row = $(this).closest("tr");    // Find the row
          var text = row.find(".keyvalue").text(); // Find the text
          var keval = text.find("input").text();
  
          alert(keval);
      });
  
  });
  </code></pre>
  
  <p>but I'm not getting any values.</p>
  
  <p>I also tried something like this but it doesn't work either:</p>
  
  <pre><code>$("#Tablesample tr:gt(0)").each(function () {
  
      var this_row = $(this);
      var key = $.trim(this_row.find('td:eq(0)').html());
      alert(key);
  });
  </code></pre>