0

Code not working:

if($('#primayins').attr('checked')) 
{    
   $("#tx_nm0x0_pricingplan").val(1); 
} 
else 
{   
   $("#tx_nm0x0_pricingplan").val(2);
}

Every time it is getting false

saidesh kilaru
  • 740
  • 2
  • 10
  • 18

1 Answers1

2

Try with:

if($('#primayins').prop('checked')) 
...

Alternatively:

if($('#checkbox').is(':checked'))
...
subZero
  • 5,056
  • 6
  • 31
  • 51