jQuery: Test if checkbox is NOT checked

前端 未结 18 974
太阳男子
太阳男子 2020-12-02 07:12

I\'m having trouble figuring this out. I have two checkboxes (in the future will have more):

  • checkSurfaceEnvironment-1
  • checkSurface
18条回答
  •  自闭症患者
    2020-12-02 07:58

    I used this and in worked for me!

    $("checkbox selector").click(function() {
        if($(this).prop('checked')==true){
           do what you need!
        }
    });
    

提交回复
热议问题