Add attribute 'checked' on click jquery

前端 未结 5 2094
滥情空心
滥情空心 2020-12-30 00:49

I\'ve been trying to figure out how to add the attribute \"checked\" to a checkbox on click. The reason I want to do this is so if I check off a checkbox; I can have my loca

5条回答
  •  不思量自难忘°
    2020-12-30 01:21

    If .attr() isn't working for you (especially when checking and unchecking boxes in succession), use .prop() instead of .attr().

提交回复
热议问题