title: How to get Upper HTML Tag with Jquery
body: <p>I trying to a class to my html page with jquery, here is my code.</p>
  
  <pre><code> &lt;tbody&gt;
     &lt;tr&gt;
      &lt;td class="itmId"&gt;1&lt;/td&gt;
      &lt;td class="entryNAmee"&gt;David&lt;/td&gt;
     &lt;/tr&gt;
     &lt;tr&gt;
      &lt;td class="itmId"&gt;2&lt;/td&gt;
      &lt;td class="entryNamee"&gt;Alan&lt;/td&gt;
     &lt;/tr&gt;
  &lt;/tbody&gt; 
  </code></pre>
  
  <p>I am changing the td to input text with jquery on clicking in the every td except 1st column. that is working fine and when the above event perform the tr become like below.</p>
  
  <pre><code>    &lt;tr&gt;
        &lt;td class="itmId"&gt;1&lt;/td&gt;
        &lt;td class="entryNAmee nowText"&gt;
          &lt;input type="text" value="Alan"&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>After making corrections an event working in blur. code is below.</p>
  
  <p>js.</p>
  
  <pre><code>$(document).on('blur','table tr td input',function()
  {   
      var fieldNewValue = $(this).val();
      var fieldNewId = $(this).closest('td.itmId').addClass("kkkkkkkkk");
      //console.log(fieldNewId);
      alert(fieldNewId);
      /*$.ajax({
          typr:"post",
          url:"updateEntry",
          dataType:'json',
          data:{newValue:fieldNewValue},
          success:function(data)
          {
              console.log("updated succesfully");
          }
      });
      */
      $(this).parents('td').text(fieldNewValue).removeClass('nowText');
      $(this).remove();
  
  }); 
  </code></pre>
  
  <p>I Want to add a class to the upper td of the the clicked td.
  I tried the closest and parents jquery api's, But didnt work, </p>
  
  <p>Anyone can please support me to how to catch the td ?</p>
  
  <p>Also what are the different between closest and parents in jquery.</p>
  
  <p>Thanks</p>