当前位置: 首页 > news >正文

选择搜索引擎进行搜索

<!DOCTYPE html>
<html>
<head><meta charset="utf-8"><title>选择搜索引擎进行搜索</title><script>function searchSelectedEngine() {var keyword = document.getElementById('keyword').value;var engine = document.getElementById('engine').value;var encodedKeyword = encodeURIComponent(keyword);var searchUrl;switch (engine) {case 'bing':searchUrl = "https://www.bing.com/search?q=" + encodedKeyword;break;case 'baidu':searchUrl = "https://www.baidu.com/s?wd=" + encodedKeyword;break;case 'sogou':searchUrl = "https://www.sogou.com/web?query=" + encodedKeyword;break;case 'so':searchUrl = "https://www.so.com/s?q=" + encodedKeyword;break;default:alert("请选择一个搜索引擎。");return;}window.open(searchUrl, "_blank");}</script>
</head>
<body><h1>选择搜索引擎进行搜索</h1><label for="keyword">输入关键词:</label><input type="text" id="keyword" required><label for="engine">选择搜索引擎:</label><select id="engine"><option value="bing">Bing</option><option value="baidu">Baidu</option><option value="sogou">Sogou</option><option value="so">So.com</option></select><button onclick="searchSelectedEngine()">搜索</button>
</body>
</html>
http://www.lryc.cn/news/428802.html

相关文章:

  • 安卓framework修改density
  • 我们如何将数据输入到神经网络中?
  • 基于python模板的药品名称识别系统设计与实现
  • 【第五节】Win32汇编程序设计
  • 2.1算法的时间复杂度与空间复杂度
  • Linux VSFTP 部署与配置
  • 【Docker】Docker Consul
  • diamond安装与使用
  • flume--数据从kafka到hdfs发生错误
  • Android笔试面试题AI答之Kotlin(14)
  • 博弈论,CF 1600E - Array Game
  • win10安装docker,打包python、java然后centos执行镜像
  • 【数据结构入门】二叉树之堆的实现
  • 智能微气候:精准调控背后的算法革命
  • eNSP 华为交换机链路聚合
  • 编译器揭秘
  • ubuntu下qt连接mysql出现 QMYSQL driver not loaded
  • html 首行缩进2字符
  • 什么是IP?
  • js拖拽交换元素位置
  • 在 C++ 中实现自定义容器的实用指南
  • 《深入浅出WPF》读书笔记.4名称空间详解
  • 电驱动总成
  • JavaScript class和正则
  • [Linux#42][线程] 锁的接口 | 原理 | 封装与运用 | 线程安全
  • 奇异递归Template有啥奇的?
  • 每天五分钟深度学习框架pytorch:神经网络工具箱nn的介绍
  • 【办公软件】安全风险 Microsoft 已阻止宏运行,因为此文件的来源不受信任
  • JavaScript语法基础之流程结构(顺序、选择、循环结构)
  • 集团数字化转型方案(四)