Answers for "javascript set input value to empty"

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
0

javascript how to set a textbox value to nothing

<input id="text">
<button onclick="myFunction()">Run</button>
<script>
  function myFunction() {
    document.getElementById("text").value = "";
  }
</script>
Posted by: Guest on September-23-2020

Code answers related to "javascript set input value to empty"

Browse Popular Code Answers by Language