1const inputFeilds = document.querySelectorAll("input");
2
3const validInputs = Array.from(inputFeilds).filter( input => input.value !== "");
4
5console.log(validInputs) //[array with valid inputs]
1Assuming the element you want to change has the id question, so you can do
2
3document.getElementById("question").value = "";