Javascript examples for DOM HTML Element:Input Date
Validate and set input field value when losing focus
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/*from w w w . jav a 2s .c o m*/ document.getElementById("searchtextbox").onblur = function() { if (this.value == "") { this.value="Search..."; } } }); </script> </head> <body> <input type="text" id="searchtextbox" value=""> </body> </html>