Note that Firefox no longer supports for each loops, so this applies to every browser, not just Internet Explorer. See this MDN article for alternatives.
Internet Explorer doesn't support "for each" loops (along with other modern browsers, which have dropped support for them). You will need to change the code to use regular for loops:
function toggle(source) {
var checkboxes = document.getElementsByName('DG1');
for (var i = 0; i < checkboxes.length; i++) {
checkboxes[i].checked = source.checked;
}
...
}
Or, you could use a library like jQuery and do it like this:
function toggle(source) {
$("input[name^=DG]").attr("checked", source.checked);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…