Html 如何仅使用一种输入类型=";“文本”;进行两次调查

Html 如何仅使用一种输入类型=";“文本”;进行两次调查,html,Html,如何仅使用一个输入TYPE=“text”进行两次调查 <FORM method="GET" action="http://www.youtube.com/results?q="> </A><br> <A HREF="http://www.youtube.com/"> </A> **<INPUT TYPE="text" name="q" size=25 maxlength=270 value="" background-colo

如何仅使用一个输入TYPE=“text”进行两次调查

<FORM method="GET" action="http://www.youtube.com/results?q="> 
</A><br> <A HREF="http://www.youtube.com/"> </A> 
**<INPUT TYPE="text" name="q" size=25 maxlength=270 value="" background-color="#ff00ff" >** 
<INPUT type="submit" name="btnY" VALUE="Youtube"> 
</FORM>  

<FORM method="GET" action="http://www.google.com/search"> 
</A> <A HREF="http://www.google.com/"> </A> 
**<INPUT TYPE="text" name="q" size=25 maxlength=270 value="" background-color="#ff00ff">** 
<INPUT type="submit" name="btnG" VALUE="Google"> 
</FORM> 


**** ****
你可以用这样的想法

html

**<INPUT id="inputLink" TYPE="text"size=25 maxlength=270 background-color="#ff00ff" >** 
<a id="searchOnYoutube" href=""><button>Youtube</button></a>
<a id="searchOnGoogle" href=""><button>Google</button></a>
jquerykeyup函数刷新Google按钮和Youtube按钮的链接
试试JSFIDLE:

您可以创建两个框架来显示查询。太好了,谢谢!更正为“我不知道为什么-1。很高兴帮助你。
$("#inputLink").keyup( function(){
    var search = $(this).val();
    $("#searchOnYoutube").attr("href", "http://www.youtube.com/results?q="+search);
    $("#searchOnGoogle").attr("href", "http://www.google.com/search="+search);
});