如何用HTML在网页中添加搜索功能?

如何用HTML在网页中添加搜索功能?,第1张

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 401 Transitional//EN" "
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
<script type="text/javascript">
<!--
windowonload = function(){
var o = documentgetElementById('openUrl');
oonclick = function(){
    // 输入的字符与网址的对应关系
var url = {
'aaa' : '0001html',
'bbb' : '0002html',
'ccc' : '0003html',
'ddd' : '0004html'
}
var key = documentgetElementById('key')value;
// 如果存在改对应关系则打开,否则打开默认网址
windowopen(url[key] || '默认网址');
}
}
//-->
</script>
 <body>
  <input type="text" id="key" /><input type="button" id="openUrl" value="打开网址"/>
 </body>
</html>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/yw/13399284.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-29
下一篇 2023-07-29

发表评论

登录后才能评论

评论列表(0条)

保存