Si lo sapevo, tieni conto che dal 15 giugno 2022 IE11 sarà dichiarato come deprecato, Microsoft consiglia Edge al suo posto, comunque il codice funzione con tutti i browser moderni.
Comunque se vuoi renderlo ugualmente compatibile con browser datati potresti implementare un polyfill che vada a colmare quella mancanza.
https://docs.microsoft.com/it-it/lifecycle/announcements/internet-explorer-11-end-of-supportcodice:const cboxs = document.querySelectorAll('input[type="checkbox"]') if (window.NodeList && !NodeList.prototype.forEach) { NodeList.prototype.forEach = Array.prototype.forEach } Array.prototype.forEach.call(cboxs, function (cbox) { cbox.addEventListener("click", function () { cboxs.forEach(function (e) { if (e !== cbox) { e.checked = false } }) }) })

Rispondi quotando