jQuery: Test if checkbox is NOT checked

前端 未结 18 1020
太阳男子
太阳男子 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:49

    To do it with .attr() like you have, to see if it's checked it would be .attr("checked", "checked"), and if it isn't it would be .attr("checked") == undefined

提交回复
热议问题