在不破坏我的代码的情况下删除函数

我正在尝试在我的Web应用程序中实现站点搜索功能,但是我想删除多余的单选按钮输入。


原始代码使您可以使用三个单选按钮来选择搜索引擎。我删除了三个按钮,但是我不知道如何删除最后一个按钮。我只想默认使用google。


// All-in-one Internal Site Search script- By JavaScriptKit.com (http://www.javascriptkit.com)

// For this and over 400+ free scripts, visit JavaScript Kit- http://www.javascriptkit.com/

// This notice must stay intact for use


//Enter domain of site to search.

var domainroot = "ts.xxxxxxx.net"


var searchaction = [ //form action for the 3 search engines

  "http://www.google.com/search"


]


var queryfieldname = ["q", "p", "q"] //name of hidden query form for the 3 search engines


function switchaction(cur, index) {

  cur.form.action = searchaction[index]

  document.getElementById("hiddenquery").name = queryfieldname[index]

}


function jksitesearch(curobj) {

  for (i = 0; i < document.jksearch.se.length; i++) { //loop through radio to see which is checked

    if (document.jksearch.se[i].checked == true)

      switchaction(document.jksearch.se[i], i)

  }

  document.getElementById("hiddenquery").value = "site:" + domainroot + " " + curobj.qfront.value

}

<form name="jksearch" action="http://www.google.com/search" method="get" onSubmit="jksitesearch(this)">



  <input id="hiddenquery" type="hidden" name="q" />

  <input name="qfront" type="text" style="width: 200px" value="" /> <input type="submit" value="Search" /><br />

  <div style="font: bold 11px Verdana;"><input name="se" type="radio" checked>

  </div>



</form>


三国纷争
浏览 116回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript