HOW DO YOU CHECK OR UNCHECK A CHECKBOX INPUT OR RADIO BUTTON?

AVADHESH PATEL

Total Post:257

Points:1285
Posted by  AVADHESH PATEL
JQuery 
 2301  View(s)
Ratings:
Rate this:
  1. AVADHESH PATEL

    Post:257

    Points:1285
    How do you check or uncheck a checkbox input or radio button?

    1.$('#num1').attr('checked', true);// Check #num1

    2.$('#num1').attr('checked', false);// Uncheck #num1

    3.$("#num1").attr('checked', 'checked');// Check #num1

    4.$("#num1").removeAttr('checked');// Uncheck #num1

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!