Getting id then selecting that element - jQuery
<p>I'm often finding myself getting various attributes, such as the id of an element or class, then selecting that element and doing something.</p>

<p>What I do now for example is:</p>

<pre><code>  var id = $(this).closest(".item").attr('id');
  $('#'+id).hide();
</code></pre>

<p>Is using '#' and including the id the best way to do this? is there a way to maybe chain these actions together? </p>

<p>Thank you!</p>
