Answers for "how to make input field empty in javascript"

4

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]
Posted by: Guest on December-17-2020
1

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 = "";
Posted by: Guest on March-18-2021

Code answers related to "how to make input field empty in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language