1if(document.getElementById("question").value.length == 0)
2{
3 alert("empty")
4}
1const inputFeilds = document.querySelectorAll("input");
2
3const validInputs = Array.from(inputFeilds).filter( input => input.value !== "");
4
5console.log(validInputs) //[array with valid inputs]
1const checkEmpty = document.querySelector('#checkIt');
2checkEmpty.addEventListener('input', function () {
3 if (checkEmpty.value && // if exist AND
4 checkEmpty.value.length > 0 && // if value have one charecter at least
5 checkEmpty.value.trim().length > 0 // if value is not just spaces
6 )
7 { console.log('value is: '+checkEmpty.value);}
8 else {console.log('No value');
9 }
10});