jQuery, Chrome, and Checkboxes. Strange Behavior

后端 未结 4 555
日久生厌
日久生厌 2021-02-07 18:03

I\'ve looked around the site and can\'t seem to find an answer for this question. Feel free to direct me to said question, if it does indeed exist.

I\'m currently trying

4条回答
  •  野的像风
    2021-02-07 19:03

    From : http://api.jquery.com/prop/ you should be using prop instead of attr

    Nevertheless, the most important concept to remember about the checked attribute is that it does not correspond to the checked property. The attribute actually corresponds to the defaultChecked property and should be used only to set the initial value of the checkbox. The checked attribute value does not change with the state of the checkbox, while the checked property does.

提交回复
热议问题