How can i do that if two inputs are empty nothing will happen now it work just when one of them are empty.
let inputs = document.querySelectorAll('.input');
let btn = document.querySelector('.btn');
btn.onclick = function() {
for (i = 0; i < inputs.length; i++) {
if (inputs[i].value == "") {
inputs[i].classList.add("error__border");
} else {
console.log('it is working');
}
}
}
.error__border {
border: 1px solid red !important;
}
<input type="text" class="input"><br><br>
<input type="text" class="input"><br><br>
<button class="btn">Add</button>
Thank tou very much!