Javascript examples for DOM HTML Element:Input Search
Input Search defaultValue Property - Get the default value of a search field:
<!DOCTYPE html> <html> <body> Search: <input type="search" id="mySearch" value="Food"> <button type="button" onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from www.j a v a2s.c o m var x = document.getElementById("mySearch").defaultValue; document.getElementById("demo").innerHTML = x; } </script> </body> </html>