js encontrar: inválido dentro de div
var contactForm = document.getElementById('contact-form');
if (contactForm.checkValidity() == false) {
var list = contactForm.querySelectorAll(':invalid');
for (var item of list) {
item.setAttribute("style", "background-color: red;")
}
}
Helpful Hyena