zoukankan      html  css  js  c++  java
  • javascript组合搜索浏览器

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2 <html xmlns="http://www.w3.org/1999/xhtml">
    3 <head>
    4 <title></title>
    5 <style type="text/css">
    6 #btnSerch
    7 {
    8 height: 21px;
    9 100px;
    10 }
    11 #select
    12 {
    13 130px;
    14 }
    15 #inpuTxtBox
    16 {
    17 223px;
    18 }
    19 </style>
    20 <script type="text/javascript">
    21
    22 function btnSerch_onclick() {
    23 var selectObject = document.getElementById("select");
    24 var selectOptions = selectObject.options;
    25 var index = 0;
    26 index = selectObject.selectedIndex;
    27
    28 document.forms[1 + index].elements[0].value = document.getElementById("inpuTxtBox").value;
    29
    30 document.forms[1+index].submit();
    31
    32 }
    33
    34 </script>
    35 </head>
    36
    37 <body>
    38 <form name="inputForm">
    39
    40
    41
    42
    43
    44
    45 查找内容:<input type="text" id="inpuTxtBox" />
    46 搜索引擎:<select id="select">
    47 <option value="001">baidu</option>
    48 <option value="002">Google</option>
    49 </select>
    50
    51 <input type="button" id="btnSerch" value="搜 索" onclick="btnSerch_onclick()" />
    52
    53 </form>
    54
    55 <form action="http://www.baidu.com/s">
    56 <input type="hidden" name="wd" value="" />
    57 </form>
    58 <form action="http://www.google.com/search">
    59 <input type="hidden" name="q" value="" />
    60 </form>
    61 </body>
    62 </html>
  • 相关阅读:
    Go语言学习之1 基本概念、环境搭建、第一个Go程序
    go环境搭建
    go 圣经阅读笔记之-入门
    RabbitMQ
    图片选择并使用base64展示
    关于c# hashtable的一个注意点
    js image to base64 摘录
    linq to sql 获取sql与参数添加到日志中
    时钟的实现
    无限级菜单的实现
  • 原文地址:https://www.cnblogs.com/mxxblog/p/2417490.html
Copyright © 2011-2022 走看看