Check/Uncheck checkbox with JavaScript (jQuery or vanilla)?

后端 未结 12 1426
渐次进展
渐次进展 2020-11-22 09:39

How can a checkbox be checked/unchecked using JavaScript, jQuery or vanilla?

12条回答
  •  遥遥无期
    2020-11-22 10:29

    I agree with the current answers, but in my case it does not work, I hope this code help someone in the future:

    // check
    $('#checkbox_id').click()
    

提交回复
热议问题