Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

input clear

document.getElementById("msg").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

clear input fild

document.getElementById('inpu').value = ''

<input type="text" onfocus="this.value=''" value="Blabla">
Comment

PREVIOUS NEXT
Code Example
Javascript :: react hook form submit outside form 
Javascript :: Add select option by using <a in AngularJS 
Javascript :: input mask 9 number add 
Javascript :: full form of json 
Javascript :: splice javascript 
Javascript :: Angular Quick Tip: Binding Specific Keys to the Keyup and Keydown Events 
Javascript :: How create a function that return element in js 
Javascript :: disable eslint curly option 
Javascript :: javascript make title blink 
Javascript :: javascript append classname 
Javascript :: vue not loading env variables 
Javascript :: kaboom.js 
Javascript :: reactjs facebook login popup trigger on load page 
Javascript :: image load fail event html 
Javascript :: react native test redux 
Javascript :: javascript compress base64 image 
Javascript :: javascript how to convert string to number 
Javascript :: change node bash root 
Javascript :: Assume that x is a char variable has been declared and already given a value. Write an expression whose value is true if and only if x is a upper-case letter. 
Javascript :: Using Props In React: Assigning CSS 
Javascript :: angular blank page no errors 
Javascript :: split 
Javascript :: moyenne javascript 
Javascript :: Angular p-dialog 
Javascript :: sort array ij js 
Javascript :: head first javascript programming 
Javascript :: jest called times 
Javascript :: how to access items inside anonymous object 
Javascript :: iis express gzip 
Javascript :: import slider material ui 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =