1 html javascript forms search
我有两个按钮提交表单.
代码是:
<form action="index.php" method="get">
<table cellpadding="2" cellspacing="3">
<tr>
<td><input type="text" name="q" size="20" /></td>
</tr>
<tr>
<td>
<input type="submit" name="site" value="site search" class="submit" />
<input type="submit" name="google" value="google search" class="submit" />
</td>
</tr>
</table>
</form>
Run Code Online (Sandbox Code Playgroud)
我想要的是,如果您按下按钮,Google结果将在新窗口中打开.我认为应该用JavaScript来完成.
<form action="http://www.google.com/search" method="get" target="_blank">
Run Code Online (Sandbox Code Playgroud)