Here is my code.
Modification for use with polyfill jquery-details.js [Edge]
var isIE = /*@cc_on!@*/false || !!document.documentMode;
var isEdge = !isIE && !!window.StyleMedia;
const details = Array.from(document.querySelectorAll("details"));
details.forEach((targetDetail) => {
targetDetail.addEventListener("click", () => {
details.forEach((detail) => {
if (detail !== targetDetail) {
if(isEdge) {
detail.className = detail.className.replace(/\bopen\b/g,"");
detail.open = false;
detail.querySelector("summary").setAttribute("aria-expanded","false");
var chil = detail.querySelectorAll("details > *");
for(var j = 0; j < chil.length; j++) {
if(chil[j].tagName != "SUMMARY") {
chil[j].style.display = "none";
}
}
} else {
detail.removeAttribute("open");
}
}
});
});
});**strong text**