工业生产新要求:请问:Hao123.com中的百度的搜索框是如何作的?我的网站也想有,该加啥代码呀?

来源:百度文库 编辑:神马品牌网 时间:2024/05/07 03:49:06

将代码放入网页中:
代码如下:

<form action="http://www.baidu.com/baidu" target="_blank">
<table bgcolor="#FFFFFF"><tr><td>
<input name=tn type=hidden value=baidu>
<a href="http://www.baidu.com/"><img src="https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-80px.gif" alt="Baidu" align="bottom" border="0"></a>
<input type=text name=word size=30>
<input type="submit" value="百度搜索">
</td></tr></table>
</form>

-------------------

另一个:

<SCRIPT language=javascript>
function g(formname) {
var url = "http://www.baidu.com/baidu";
if (formname.s[1].checked) {
formname.ct.value = "2097152";
}
else {
formname.ct.value = "0";
}
formname.action = url;
return true;
}
</SCRIPT>
<form name="f1" onsubmit="return g(this)">
<table bgcolor="#FFFFFF" style="font-size:9pt;">
<tr height="60"><td valign="top"><img src="https://gss0.bdstatic.com/70cFsjip0QIZ8tyhnq/img/logo-137px.gif" border="0" alt="baidu"></td>
<td>
<input name=word size="30" maxlength="100">
<input type="submit" value="百度搜索"><br>
<input name=tn type=hidden value="bds">
<input name=cl type=hidden value="3">
<input name=ct type=hidden>
<input name=si type=hidden value="www.guoxue.com">
<input name=s type=radio> 互联网
<input name=s type=radio checked> www.guoxue.com
</td></tr></table>
</form>