the Forum

How to create a simultaneous search box using HTML/JavaScript?

Posted on March 13, 2013 by Arnold
Total Posts: 1  |  Join date: 03-13-13

Tags: There are no tags for this entry.

2 answers, add yours below

Posted on on March 13, 2013 at 8:31pm
by Michael Rosario

Hey Arnold,

There are a few pieces we need before we start.

First, the URL queries used by search engines. For example google's search is activated by www.google.com/#q=SEARCH_TERM and search.yahoo.com/search?p=SEARCH_TERM
Second, a form, where a user can add the keyword. A javascript script will run when you click submit.
Third, a script that opens browsers in new window.

<html>
<
head>
<
script>
function 
formSubmit()
{
var term document.getElementById("keyword").value;
window.open('http://www.google.com/#q='+term,'google','width=600,height=600');
window.open('http://search.yahoo.com/search?p='+term,'yahoo','width=600,height=600');
window.open('http://www.bing.com/search?q='+term,'bing','width=600,height=600');
}
</script>
</head>
<
body>

<
form id="frm1">
<
input id="keyword" name="keyword" value="" placeholder="keyword">
<
input type="button" onclick="formSubmit()" value="SEARCH">
</
form>

</
body>
</
html


 

Posted on on December 12, 2015 at 6:48am
by GESTION DE AGUA

,.l,.;lkjbnj

 
add your answers here
comments powered by Disqus