参考链接:https://stackoverflow.com/questions/10650233/checked-checked-vs-checked-true 问: What is the difference between the below two usages? document.getElementById('myRadio').checked = "checked"; and document.getElementById('myRadio').checked = tr…
HTML INPUT元素有个checked属性,多数情况type为radio和checkbox. 当创建一个input,checked属性赋值为true,添加到DOM文档中,当再次取checked属性时,IE6.7竟然是false. 测试如下 var div = document.createElement('div') var input = document.createElement('input') input.type = 'checkbox' input.checked = true…