title: Radio button second click makes uncheck
body: <p>If my radio button previously checked and i try to uncheck with second click i have to click once more. So it means if my radio button previously checked i got to clicked 2 times for unchecked but it should works with only 1 click . How can i fix it. Here is 2 codes they both have the same issue. I show both scripts here .Thanks For Helping!</p>
  <pre><code> $(function(){
      $('input[name=&quot;rad&quot;]').click(function(){
          var $radio = $(this);
  
          // if this was previously checked
          if ($radio.data('waschecked') == true)
          {
              $radio.prop('checked', false);
              $radio.data('waschecked', false);
          }
          else
              $radio.data('waschecked', true);
  
          // remove was checked from other radios
          $radio.siblings('input[type=&quot;radio&quot;]').data('waschecked', false);
      });
  });
  </code></pre>
  <hr />
  <pre><code> $(&quot;input:radio&quot;).on(&quot;click&quot;, function (e) {
      var inp = $(this);
      if (inp.is(&quot;.clicked&quot;)) {
          inp.prop(&quot;checked&quot;, false).removeClass(&quot;clicked&quot;);
      } else {
          $(&quot;input:radio[name='&quot; + inp.prop(&quot;name&quot;) + &quot;'].clicked&quot;).removeClass(&quot;clicked&quot;);
          inp.addClass(&quot;clicked&quot;);
      }
  });
  </code></pre>
  <hr />
  <pre><code>&lt;input type=&quot;radio&quot; name=&quot;rad&quot; id=&quot;Radio0&quot; checked=&quot;checked&quot;/&gt;
  &lt;input type=&quot;radio&quot; name=&quot;rad&quot; id=&quot;Radio1&quot; /&gt;
  &lt;input type=&quot;radio&quot; name=&quot;rad&quot; id=&quot;Radio2&quot; /&gt;
  &lt;input type=&quot;radio&quot; name=&quot;rad&quot; id=&quot;Radio4&quot; /&gt;
  &lt;input type=&quot;radio&quot; name=&quot;rad&quot; id=&quot;Radio3&quot; /&gt;
  </code></pre>
  <hr />
  <p>and here is my html and jsfiddle</p>
  <p><a href="http://jsfiddle.net/fbyg1htz/" rel="nofollow noreferrer">http://jsfiddle.net/fbyg1htz/</a></p>
  <p><a href="http://jsfiddle.net/7g684219/" rel="nofollow noreferrer">http://jsfiddle.net/7g684219/</a></p>