How do I check if a checkbox is checked with JQuery?

前端 未结 2 1666
长情又很酷
长情又很酷 2020-12-18 12:07

I am trying to allow a click function if the user has checked a checkbox on the page. Otherwise, I want to add a class to the #additional_foreign button.

I think I

2条回答
  •  情歌与酒
    2020-12-18 12:16

    try using $('#foreign_checkbox').is(":checked") - rest of the code looks fine

    If this was my code I'd do something like this to make it work:

    
    
    
    
    

提交回复
热议问题