How to check a input field 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 make input field empty in javascript
Assuming the element you want to change has the id question, so you can do
document.getElementById("question").value = "";