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 :: remove null from object lodash 
Javascript :: javascript promise multi function error 
Javascript :: jquery escape 
Javascript :: using for loops to add an event listener 
Javascript :: on second click javascript 
Javascript :: how to use bootstrap in reactjs 
Javascript :: Javascript Reverse Words O(n) time O(1) space 
Javascript :: throttle ajax requests 
Javascript :: one dimensional array in javascript 
Javascript :: exitBeforeEnter not working 
Javascript :: SHOPIFY CUSTOMER WITH REGISTRATION 
Javascript :: js deconstruct rename 
Javascript :: gsap cdn not working 
Javascript :: forEach ActiveLink 
Javascript :: how to import images from public folder in react js 
Javascript :: setFocus() in searchbar ionic4 
Javascript :: get last day of month js 
Javascript :: styling font awesome icons next js 
Javascript :: what is react-instantsearch-dom 
Javascript :: a critical point in an array is defined as either a local maxima or a local minima 
Javascript :: react-popper-2 
Javascript :: Automatic update javascript fileversion 
Javascript :: javascript Least prime factor of numbers till n 
Javascript :: regex to allow spaces and characters 
Javascript :: save slug on schema pre save in node js 
Javascript :: add item or nothing array js 
Javascript :: slick slider on change 
Javascript :: make react navigation to always re render 
Javascript :: sort an array in descending order javascript 
Javascript :: regex for erlang online 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =