jQuery: Test if checkbox is NOT checked

前端 未结 18 983
太阳男子
太阳男子 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 08:10

    if($("#checkbox1").prop('checked') == false){
        alert('checkbox is not checked');
        //do something
    }
    else
    { 
        alert('checkbox is checked');
    }
    

提交回复
热议问题