I wrote a code, but this code is only applied to one field.
I want it to apply to all fields
const el = document.querySelectorAll("select.jet-select__control");
el.addEventListener('change', function handleChange(event) {
if (event.target.value ==='') {
location.reload(); element.classList.add("error");
}
});
const el = document.querySelectorAll("select.jet-select__control");
el.addEventListener('change', function handleChange(event) {
if (event.target.value ==='') {
location.reload(); element.classList.add("error");
}
});
Only applies to one field!!!!!!
New contributor
aylin web is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1