views:

38

answers:

0

I have a very strange issue with a simple set of jquery stmts. I have the following in my jsp

$(document).ready(function() {
  alert("in doc ready");
  $("input[name='receivingOption']").each(function() {
    alert($(this).val());
    if($(this).val() == $("#deliveryMethod").val()) {
      alert($("#" + $(this).attr("id") + "label").attr("id"));
      $(this).attr("checked","checked");
      $('#' + $(this).attr("id") + 'label').addClass('ui-state-active'); 
    }
  });   
});

Everything works fine as long as I have the alerts, once I remove them thinking alls well, the script stops working. I know... but its happening. Please help!