I have a lot input boxes and I need to make a condition that checks if all of them are empty how can I do this in javascript with a single variable. This is what I have, but it only checks 1 box
function boxes() {
var box_a = document.getElementById('box_a');
if(box_a==="") {
alert("box not filled")
return false;
}
<input type="text" id="box_a">
Try like this: