Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript clear input string

 inputField.value = " ";
Comment

clear input field javascript

<form id="myForm">
  First name: <input type="text" name="fname" value="Demo"><br>
  Last name: <input type="text" name="lname"><br><br>
    <input type="file" name="Photo" class=" custom-file-input" id="photo">
  <input type="button" onclick="myFunction()" value="Reset form">
</form>
     
<script>
function myFunction() {
    document.getElementById("myForm").reset();
}
</script>
 Run code snippetHide results
Comment

how to clear textbox value in js

<input type="text" value="A new value" onfocus="if(this.value=='A new value') this.value='';">
Comment

clear input value with javascript

inputField.value = " ";
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript this Inside Object Method 
Javascript :: longest string 
Javascript :: how to use settimeout in react 
Javascript :: js to find min value in an array 
Javascript :: creating javascript class 
Javascript :: jq break line 
Javascript :: js for await 
Javascript :: difference between single quotes and double quotes in javascript 
Javascript :: NodeJS Content-Type 
Javascript :: map function in js 
Javascript :: vuetify use selected value 
Javascript :: target data option select vue js 
Javascript :: javasccript this.innerHTML 
Javascript :: add options to select box dynamically jquery 
Javascript :: vue js documentation 
Javascript :: node js crud operation 
Javascript :: js function run one another 
Javascript :: catch status code 403 in fetch 
Javascript :: web scraping using javascript 
Javascript :: Group item by date 
Javascript :: dynamic classname react 
Javascript :: add select option jquery 
Javascript :: How to compare two different date formats in javascript 
Javascript :: autocomplete html in react 
Javascript :: javascript create array 
Javascript :: express example 
Javascript :: datatables add row with id 
Javascript :: interval manage for javascript 
Javascript :: javascript in python 
Javascript :: sort array 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =