Javascript examples for DOM HTML Element:Form Event
Set default to Input field type file
<html> <head></head> <body> Name: //from ww w .j a v a2 s . c o m <input type="file" id="myText" value="old value"> <button type="button" onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("myText").defaultValue="default.jpeg"; document.getElementById("demo").innerHTML = x; } </script> </body> </html>