title: How to get Id of an element using jQuery Closest() function
body: <p>i have following HTML struture, I am unable to get the value of a radio button when i select my selector as explained in my Jquery Code Below.</p>
  
  <pre><code>&lt;div class="option-radio-box"&gt;
  &lt;input id="pixel" class="css-checkbox" type="radio" value="pixel" name="type"&gt;
  &lt;label class="css-label" for="radio1"&gt;
  &lt;img width="25" height="20" alt="" src="images/opt-ico1.png"&gt;
  Pixel by
  &lt;span&gt;Pixel&lt;/span&gt;
  &lt;/label&gt;
  &lt;/div&gt;
  &lt;div class="option-radio-box"&gt;
  &lt;input id="pair" class="css-checkbox" type="radio" checked="checked" value="pair" name="type"&gt;
  &lt;label class="css-label" for="radio2"&gt;
  &lt;img width="25" height="20" alt="" src="images/opt-ico2.png"&gt;
  Duplicate
  &lt;span&gt;Search&lt;/span&gt;
  &lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And following Jquery code, </p>
  
  <pre><code>  $('.css-label').on('click', function() {
    alert(jQuery(this).closest('input:radio[name=type]').id);});
  </code></pre>