title: jQuery $(this).closest show & hide
body: <p>I've got a table with multiple rows. In each row is a Show Details Button and a Hide Details button. On clicking show details I want the hide details button to only show for the specific row. I thought the .closest() function would work but it hasn't yet. </p>
  
  <p>Here is the HTML</p>
  
  <pre><code>&lt;table&gt;
      &lt;tr id="1"&gt;
        &lt;td&gt;&lt;button class='view'&gt;View Details&lt;/button&gt;&lt;button class='hide' style='display:none;'&gt;Hide Details&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;tr id="2"&gt;
        &lt;td&gt;&lt;button class='view'&gt;View Details&lt;/button&gt;&lt;button class='hide' style='display:none;'&gt;Hide Details&lt;/button&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Here is the jQuery</p>
  
  <pre><code>$(".view").click(function() {   
      $("#patient").show("");
      $(this).hide();
      $(this).closest(".hide").show();
  });
  </code></pre>