使用$("checkbox").attr("checked")时显示未定义。
$("checkbox").prop("checked")完美解决
参考地址:https://www.jb51.net/article/51136.htm