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