title: How to toggle the check state of a radio input element on click?
body: <p>How to (un)check a radio input element on click of the element or its container?</p>
  
  <p>I have tried the code below, but it does not uncheck the radio.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div class="is"&gt;
      &lt;label&gt;&lt;input type="radio" name="check" class="il-radio" /&gt; Is &lt;/label&gt;
      &lt;img src="picture" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>$(".is label, .is ").click(function () {
      if (!$(this).find(".il-radio").attr("checked")) {
          $(this).find(".il-radio").attr("checked", "checked");
      } else if ($(this).find(".il-radio").attr("checked") == "checked") {
          $(this).find(".il-radio").removeAttr("checked");
      }
  });
  </code></pre>