Javascript examples for DOM HTML Element:Input Search
Input Search value Property - Get the text of a search field:
<!DOCTYPE html> <html> <body> Search: <input type="search" id="mySearch" value="Food"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//w w w. j av a 2 s . co m var x = document.getElementById("mySearch").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>