const select = document.querySelector(".dropdown-el");
select.addEventListener("click", function (e) {
e.preventDefault();
e.stopPropagation();
this.classList.toggle("expanded");
console.log("#" + e.target.getAttribute("for").outerHTML("checked",true));
});
window.addEventListener("click", function () {
select.classList.remove("expanded");
});
const dropdown = document.querySelector('.dropdown-el');
const activeClass = 'expanded';
dropdown.addEventListener('click', e => {
e.preventDefault();
e.stopPropagation();
e.currentTarget.classList.toggle(activeClass);
e.target.previousElementSibling.checked = true;
});
document.addEventListener('click', () => dropdown.classList.remove(activeClass));