Answers for "clear button in html"

4

reset button html

<input type="reset" value="Reset" />
Posted by: Guest on February-23-2020
0

how to make a clear button in javascript

<script>
  function clear_inputs(){
    inputs=document.getElementsByClassName('inputs')
    for(input of inputs){
    	input.value=' ' ///this emptys the inputs
    }
  }
</script>
<input class='inputs' type="text">
<input class='inputs' type="text">
<input class='inputs' type="text">

<button onclick='clear_inputs()'>Clear</button>
Posted by: Guest on May-27-2021

Browse Popular Code Answers by Language