title: change radio button checked attribute on basis of label html using jquery
body: <p>I have a select drop down and if the onchange of select drop-down the option is yes than all the radio buttons should change to yes</p>
  <pre><code>&lt;select class=&quot;is_poly_cover&quot;&gt;
     &lt;option&gt;No&lt;/option&gt;
     &lt;option&gt;Yes&lt;/option&gt;
  &lt;/select&gt;
  
  
  
  &lt;input type=&quot;radio&quot;  name=&quot;v1&quot; class=&quot; additional_option_type_7&quot; checked=&quot;checked&quot; value=&quot;251&quot;&gt;
  &lt;label class=&quot;&quot; for=&quot;251&quot;&gt;YES&lt;/label&gt;
  
  &lt;input type=&quot;radio&quot; name=&quot;v1&quot; class=&quot; additional_option_type_7&quot; value=&quot;254&quot;&gt;
  &lt;label class=&quot;&quot; for=&quot;254&quot;&gt;NO&lt;/label&gt;
  
  &lt;input type=&quot;radio&quot;  name=&quot;v2&quot; class=&quot; additional_option_type_8&quot; checked=&quot;checked&quot; value=&quot;255&quot;&gt;
  &lt;label class=&quot;&quot; for=&quot;255&quot;&gt;YES&lt;/label&gt;
  
  &lt;input type=&quot;radio&quot; name=&quot;v2&quot; class=&quot; additional_option_type_8&quot;  value=&quot;256&quot;&gt;
  &lt;label class=&quot;&quot; for=&quot;256&quot;&gt;NO&lt;/label&gt;
  </code></pre>
  <p>Note: Everthing here is made dynamically and i dont have access to change the html so cannot add classes or id to the elements.</p>
  <p>Here on change of is_poly_cover if its yes than all radio button goes to yes and if is_poly_cover no than all radio btns goes to No</p>
  <p>attempt:</p>
  <pre><code>var set_classes = ['additional_option_type_8','additional_option_type_7'];
  
  $('body').delegate('.is_poly_cover', 'change', function(e) {
      var is_poly_cover_text = $(&quot;.is_poly_cover&quot;).find(&quot;option:selected&quot;).text().toLowerCase();
      if(is_poly_cover_text == 'yes'){
          var label = '';
          var req_elem = '';
          for(var i=1;i&lt;set_classes.length;i++) {
              req_elem = &quot;.&quot;+set_classes[i];
              //console.log(req_elem)
              label = $(req_elem).next().html().toLowerCase();
              console.log(label)
          }
  
      }
  });
  </code></pre>