Salvar vários rádios verificados no localStorage
function saveFav() {
let checked = Array.from(document.querySelectorAll("input[type=radio]:checked")).map(e => e.id);
localStorage.setItem('checked', JSON.stringify(checked));
}
function setFav() {
const getChecked = JSON.parse(localStorage.getItem("checked"));
let radios = [...document.querySelectorAll("input[type=radio]")];
radios.forEach(e => {
e.removeAttribute("checked")
getChecked.forEach(id => {
if (e.id === id) {
e.setAttribute("checked", "checked");
}
})
});
}
SAMER SAEID