how to check if input is empty code example

Example 1: check if input is empty css

/* If input is not empty */
input:not(:placeholder-shown) {
  /* You need to add a placeholder to your fields. For example: <input "placeholder=" "/> */
  border-color: green;
}

/* If input is empty */
input:placeholder-shown {
  border-color: red;
}

Example 2: how to check if all inputs are not empty with javascript

const inputFeilds = document.querySelectorAll("input");

const validInputs = Array.from(inputFeilds).filter( input => input.value !== "");

console.log(validInputs) //[array with valid inputs]