Javascript examples for DOM HTML Element:Input Text
Open a window and Do google search, get key word from input text field
<html> <head> <base target="_top"> <script> function doSearch() {//ww w . j ava 2 s.co m var searchFor = document.getElementById("txtSearchFor").value; window.open("https://www.google.com/search?q=" + searchFor); } </script> </head> <body> <h1>Sidebar</h1> <input type="text" id="txtSearchFor"> <input type="button" value="Search" id="btnSearch" onclick="doSearch()"> </body> </html>