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

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

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

12条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 10:21

    For single check try

    myCheckBox.checked=1
     Call to her

    for multi try

    document.querySelectorAll('.imChecked').forEach(c=> c.checked=1)
    Buy wine: 
    Play smooth-jazz music:
    Shave:

提交回复
热议问题