ToggleClass?

ToggleClass?

Hey All!! 
I just started using jquery, and i have the following question. I've got the following HTML:


  1. <div class='payment_options closed'>
  2.         <input id='payment1' name="payment_type" value="1" type="radio" />
  3. </div>
  4. <div class='payment_options closed'>
  5.         <input id='payment2' name="payment_type" value="1" type="radio" />
  6. </div>
  7. <div class='payment_options closed'>
  8.         <input id='payment3' name="payment_type" value="1" type="radio" />
  9. </div>
Now, i would like to, if the input is Selected, the 'closed' class changes to 'open'. I first tried .change, but that didnt work:


  1. <script type="text/javascript">
  2. $(".payment_options").change(function () {
  3.       $(this).toggleClass("closed");      
  4.       $(this).toggleClass("open");       
  5.     });
  6. </script>    
How should i change it?