checkbox values + IE8 = really weird behaviour?

checkbox values + IE8 = really weird behaviour?

This is a snippet of my HTML:

  1. <div id="step4">
  2.     Period:<br>
  3.     <input class="price" type="radio" value="3" name="period"> 3 months<br>
  4.     <input class="price" type="radio" checked="" value="6" name="period"> 6 months<br>
  5.     <input class="price" type="radio" value="12" name="period"> 12 months<br>
  6.     <br>
  7.     Addons:<br>
  8.     <input id="m_obj" class="price" type="checkbox" name="m_obj" value="1"> Foo<br>
  9.     <input id="p_obj" class="price" type="checkbox" name="p_obj" value="1"> Bar<br>
  10.     <br>
  11.     Price: <span id="tot_price" class="blue">5400</span><br>
  12.     <input class="submit" type="submit" value="next">
  13. </div>

And the javascript:

  1. $("#o_annons .price").change(function() {
  2.     var price=0;
  3.     if ($("input[@name='period']:checked").val() == '3') {
  4.         price = 2900;
  5.     }
  6.     if ($("input[@name='period']:checked").val() == '6') {
  7.         price = 5400;
  8.     }
  9.     if ($("input[@name='period']:checked").val() == '12') {
  10.         price = 8900;
  11.     }
  12.     if($("#m_obj").attr("checked")) {
  13.         price = price + (1000 * $("input[@name='period']:checked").val());  
  14.     }   
  15.     if($("#p_obj").attr("checked")) {
  16.         price = price + (1000 * $("input[@name='period']:checked").val());  
  17.     }
  18.     $("#tot_price").html(price);
  19. });

Works well in all browsers, except IE8/IE9 (not checked IE7). The problem I get in IE is this:

 As you change the radio buttons, the value changes. If you however change to a value that you've already had once (like, clicking 12, then 6, then 12 again) the value just becomes empty. This also applies to the checkboxes, any "combination" that you've already had once just becomes 0 or empty.

I first though the price variable might be at fault, but I've alert-debugged it using $("input[@name='period']:checked").val() as well, and it seems the val() itself is empty. Any ideas?

Used:
IE9 (9.0.8112.16421) Win7 32bit
IE8 (unknown) WinXP 32bit
jQuery 1.5.1