根据用户输入动态创建 http link

creating http link dynamically according to the user input

我现在正在构建一个包含搜索框的网页。如何创建根据搜索框上的输入而变化的搜索查询?

<input type=text name="searchquery"/>
<input type=button name=search value="search" onClick=changeQuery()/>

changeQuery(){
????
}

无论如何我设法得到了想要的输出...

<input type=text id='sq' name="searchquery"/>
<input type=button name=search value="search" onClick=changeQuery()/>

changeQuery(){
var input_query=document.getElementById('sq').value;
window.location="http://www.google.com/search?q="+input_query+"myString";
}