title: Mark the radio button checked after clicking the anchor tag
body: <p>When I click on the anchor tag, the radio button inside it must be marked as checked. The data is coming through a loop so there is a large amount of data.  Here is my code:</p>
  
  <pre><code>&lt;a class="toggleanchor sectionsdiv accordion-toggle &lt;?php if($i!=1){ ?&gt; collapsed &lt;?php } ?&gt;" data-toggle="collapse" data-parent="#accordion" href="#collapseOne&lt;?=$i;?&gt;"&gt;
      &lt;div class="col-md-12 col-sm-12 col-xs-12"&gt;
          &lt;div class="form-group col-md-4 col-sm-4" style="padding:0;"&gt;
              &lt;div class="checkbox checkreward"&gt;
                  &lt;label&gt;
                      &lt;input type="radio" name="radio" &lt;?php if($i==1){ ?&gt; checked &lt;?php } ?&gt; class="form-control radio-height" id="radioid&lt;?=$z;?&gt;" value="&lt;?=$reward['amt'];?&gt;"/&gt; $&lt;?=$reward['amt'];?&gt;
                      &lt;input type="hidden" id="giftval-&lt;?=$z;?&gt;" value="&lt;?= ucwords($reward['gift']);?&gt;"/&gt; 
                  &lt;/label&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div id="hight-light&lt;?=$z;?&gt;" class="col-md-8 col-sm-8 textreward"&gt;
              &lt;h2&gt;&lt;?=  ucwords($reward['entry']);?&gt;&lt;/h2&gt;
              &lt;h4 class="text-uppercase text-white"&gt;    
                  &lt;b&gt;&lt;?=$reward['sup'];?&gt;&lt;/b&gt;
              &lt;/h4&gt;
          &lt;/div&gt;&lt;!--.col1 text-center--&gt;
      &lt;/div&gt;
      &lt;br clear="all" /&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>This anchor is repeated in the loop, so the data will change every time. how can i make it work? I tried different code but couldn't get it to work. Like</p>
  
  <pre><code>$(".toggleanchor").click(function(event) {    
      $(radio).attr("checked", true);
  });
  </code></pre>