$(this).attr("checked") 为 undefined

Check the checkbox in Jsp:

        Using Jquery's attr method:

          var selectStatus  =     $("#checkboxId").attr("checked");

        Selected if selectStatus = true

        Selected if selectStatus = false

 But sometimes:   selectStatus is undefined 

         At this time, you need to change the value method: selectStatus =  $("#checkboxId").prop("checked");

     Properties with two properties, true and false, such as checked, selected or disabled use prop(), others use attr()

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326996480&siteId=291194637