title: How to trigger a click on checked radio button in jquery or javascript
body: <p>Javascript:  </p>
  
  <pre><code>if (GetCookie('prev_radio_value')!=null){   
       alert(GetCookie('prev_radio_value'));
       $(":radio[value="+GetCookie('prev_radio_value')+"]").attr('checked',true);
       $(":radio[value="+GetCookie('prev_radio_value')+"]").triggerHandler('click');
  
       $(':radio:checked').triggerHandler('click');
  
       $('input:radio[name=theme]:checked').click();
  
      }else{
          alert("clicking first");
       $("input:radio:first").attr("checked", true).trigger("click"); 
       }
  </code></pre>
  
  <p>HTML code: </p>
  
  <pre><code>&lt;ul&gt;
   &lt;li&gt;&lt;input type="radio"  name="theme" value="theme1"/&gt;Theme1&lt;/li&gt;
   &lt;li&gt;&lt;input type="radio"  name="theme" value="theme2"/&gt;Theme2&lt;/li&gt;
   &lt;/ul&gt;
  </code></pre>
  
  <p>this code is inside div -> 'checkbox_div' </p>
  
  <p>click function : </p>
  
  <pre><code>$("#checkbox_div input:radio").click(function() {
    alert("clicked") ;
   });
  </code></pre>
  
  <p>I have used the trigger click in 3 ways but none of them worked or triggered the click event.</p>
  
  <p>example link : <a href="http://jsbin.com/ezesaw/1/edit" rel="nofollow">http://jsbin.com/ezesaw/1/edit</a> is not triggering the click event upon selection of first radio button. </p>