title: Jquery If radio button is checked
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2195125/check-of-specific-radio-button-is-checked">Check of specific radio button is checked</a>  </p>
  </blockquote>
  
  
  
  <p>I have these 2 radio buttons at the moment so that the user can decide whether they need postage included in the price or not:</p>
  
  <pre><code>&lt;input type="radio" id="postageyes" name="postage" value="Yes" /&gt; Yes
  &lt;input type="radio" id="postageno" name="postage" value="No" /&gt; No
  </code></pre>
  
  <p>I need to use Jquery to check if the 'yes' radio button is checked, and if it is, do an append function. Could someone tell me how I'd do this please?</p>
  
  <p>Thanks for any help</p>
  
  <p>edit:</p>
  
  <p>I've updated my code to this, but it's not working. Am I doing something wrong?</p>
  
  <pre><code>&lt;script type='text/javascript'&gt;
  // &lt;![CDATA[
  jQuery(document).ready(function(){
  
  $('input:radio[name="postage"]').change(function(){
      if($(this).val() == 'Yes'){
         alert("test");
      }
  });
  
  });
  
  // ]]&gt;
  &lt;/script&gt;
  </code></pre>