<html>
<head>
<script language="javascript" >
function baidu()
{
var startDate, endDate ,d ;
d = new Date();
startDate =d.getYear() + "-"+ (d.getMonth() + 1) + "-" + d.getDate() ; //开始日期
endDate =d.getYear() + "-"+ d.getMonth() + "-" + d.getDate(); // 结束日期
window.open("http://www.baidu.com/s?tn=tcha_pg&word="+startDate+"endDate="+endDate+"");
}
function google()
{
window.open("http://www.google.cn/search?hl=zh-CN&q="+document.myform.mytext.value+"
&btnG=Google+%E6%90%9C%E7%B4%A2&meta=&aq=-1&oq=");
}
function KeyDown(event) //回车提交数据 ( 这样火符也可以用 )
{
event = event ? event : (window.event ? window.event : null);
if (event.keyCode == 13)
{
event.returnValue=false;
event.cancel = true;
google();
}
}
</script>
</head>
<body>
<center>
<form name="myform">
<input type="text" value="请输入搜索内容" name="mytext" maxlength="2048" size="55"
onkeydown="KeyDown(event)" onMouseOver="this.select();"/>
<input type="button" value="google" onclick="google()" />
<input type="button" value="最新报告" onclick="baidu()" />
</form>
</center>
</body>
</html>
<style type="text/css">.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<style type="text/css">.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
分享到:
相关推荐
搜索框特效下拉菜单选项,简单实用,美观大方
昨天我们主要讲了京东首页的基本布局,今天我们主要来逐步实现京东首页的页面顶部、Logo&搜索框。首先我们来看下我们今天将要实现的效果: 下面页面布局详细分析: 1、页面头部分三个部分依次实现:五角星图、收藏...
使用Js控制输入灰色字搜索框多种搜索样式集合下载
JS搜索框提示 纯JS 结构无数据库function smanPromptList(arrList,objInputId){ this.style = "background:#E8F7EB;border: 1px solid #CCCCCC;font-size:14px;cursor: default;" if (arrList.constructor!=Array){...
JS中国各大城市搜索框代码,直接输入可搜索城市(支持汉字/拼音)。
JavaScript应用实例-微信搜索框输入消息.js
下拉的select框中添加一个搜索框,在select 框中添加新的样式searchClass,就可以使用
js带搜索框的下拉列表js带搜索框的下拉列表js带搜索框的下拉列表
搜索框相信大家都不陌生,当输入内容时,下面会出现提示。这类提示就叫做搜索框的智能提示,使用Servlet和Ajax来实现。主要介绍实现原理和代码的前后台实现
JS百度搜索框联想词提示代码是一款纯javaScript仿百度搜索框联想词提示代码。
JS仿百度搜索框输入文字删除代码是一款带删除效果的input输入框删除文字搜索框代码。
漂亮,导航栏,和动画背景,和搜索框
搜索框字段自动补全js和css,需要引入到html页面中。
搜索框jQuery特效,搜索框js特效,网站搜索按钮和提交验证表单。
JQ JS javascript layui UI框架 带搜索下拉框 select
本文实例为大家分享了JS实现百度搜索框的具体代码,供大家参考,具体内容如下 向输入框动态输入时关键词,将当前关键词作为问号参数后面的值,因为要跨域使用百度的接口,所以通过 JSONP 跨域创建 Ajax 请求。...
仿bilibili搜索框效果(三句代码实现)