gpt4 book ai didi

javascript - 如何用显示 "search"的按钮替换谷歌自定义搜索引擎的放大镜?

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:02:25 24 4
gpt4 key购买 nike

我正在使用 GCSE 的基本代码和标准“紧凑”主题:

<script>
(function() {
var cx = '111111111111111111111:11111111111';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>

这将输入按钮呈现为:

<td class="gsc-search-button">
<input type="image" src="http://www.google.com/uds/css/v2/search_box_icon.png" class="gsc-search-button gsc-search-button-v2" title="search">
</td>

我希望它是这样的

<td class="gsc-search-button">
<input type="button" value="search" title="search">
</td>

我似乎不知道该怎么做。这可能吗?

最佳答案

function myCallback() {
$("td.gsc-search-button input").attr("type", "submit").attr("value", "submit");
}

window.__gcse = {
callback: myCallback
}; //.......load google CSE tag after this

这对我有用,它使所有事件处理程序保持原样。

关于javascript - 如何用显示 "search"的按钮替换谷歌自定义搜索引擎的放大镜?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29902393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com