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