title: Add css class to parent of radio button when checked using jquery
body: <p>I'm trying to add a css class to the  div.from of my radio button if it is checked. Then remove if it is not checked.</p>
  
  <p><strong>And the html:</strong></p>
  
  <pre><code>&lt;div style="width:49.5%;height:auto;float:left;" class="from"&gt;
  
  
  &lt;label&gt;
  &lt;div class="fromm" id="order"&gt;
      &lt;div class="frairimg"&gt;&lt;/div&gt;
      &lt;div class="frfromdetails"&gt;&lt;/div&gt;
      &lt;div class="frarrow"&gt;&lt;/div&gt;
      &lt;div class="frfromdetails"&gt;&lt;/div&gt;
      &lt;div class="frrefund"&gt;&lt;/div&gt;
      &lt;div class="radio"&gt;&lt;input type="radio" name="from" id="something" class="getvalue"&gt;&lt;/div&gt;
      &lt;div class="frfnumber"&gt;&lt;/div&gt;
      &lt;div class="roundfare"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/label&gt;
  
  &lt;label&gt;
  &lt;div class="fromm" id="order1"&gt;
      &lt;div class="frairimg"&gt;&lt;/div&gt;
      &lt;div class="frfromdetails"&gt;&lt;/div&gt;
      &lt;div class="frarrow"&gt;&lt;/div&gt;
      &lt;div class="frfromdetails"&gt;&lt;/div&gt;
      &lt;div class="frrefund"&gt;&lt;/div&gt;
      &lt;div class="radio"&gt;&lt;input type="radio" name="from" id="something1" class="getvalue"&gt;&lt;/div&gt;
      &lt;div class="frfnumber"&gt;&lt;/div&gt;
      &lt;div class="roundfare"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/label&gt;
  
    &lt;label&gt;
  &lt;div class="fromm" id="order2"&gt;
      &lt;div class="frairimg"&gt;&lt;/div&gt;
      &lt;div class="frfromdetails"&gt;&lt;/div&gt;
      &lt;div class="frarrow"&gt;&lt;/div&gt;
      &lt;div class="frfromdetails"&gt;&lt;/div&gt;
      &lt;div class="frrefund"&gt;&lt;/div&gt;
      &lt;div class="radio"&gt;&lt;input type="radio" name="from" id="something2" class="getvalue"&gt;&lt;/div&gt;
      &lt;div class="frfnumber"&gt;&lt;/div&gt;
      &lt;div class="roundfare"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/label&gt;                                  
  
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>&lt;style&gt;
  .checked11 { background: red; }
  &lt;/style&gt;
  </code></pre>
  
  <p><strong>Here's what I came up with in jquery:</strong></p>
  
  <pre><code>&lt;script&gt;
  $(document).ready(function() {
    $('input:radio').click(function() {
      $('input:radio[name='+$(this).attr('name')+']').parent().removeClass('checked11');
          $(this).parent().addClass('checked11');
  
      });
  });
  
  &lt;/script&gt; 
  </code></pre>
  
  <p>here my problem is the class is applying for radio button only but want it to apply for  div.from</p>
  
  <p>Thankyou.
  Naresh Kamireddy</p>