js checkbox.setAttribute("checked", false)备注

  js checkbox.setAttribute("checked", false):

  要注意false不能用引号括起来,否则将不会使复选框不被选中。

  不过,在使用js执行 checkbox.getAttribute("checked") 时,有时却不被firefox兼容,所以必须使用checkbox.checked来获取

checkbox的checked属性。

原文地址:https://www.cnblogs.com/pricks/p/1696669.html