我正在将网站搜索转移到谷歌自定义搜索。
文本的旧输入如下所示:
<input type="text" value="Search this website..." name="s" id="searchbox" onfocus="if (this.value == 'Search this website...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this website...';}" />
现在我需要将 attr 'name' 设置为 'q',如下所示:
<input type="text" value="Search this website..." name="q" id="searchbox" onfocus="if (this.value == 'Search this website...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search this website...';}" />
奇怪的是,当我将名称换成 q 时,我无法清除焦点上的搜索框。我错过了一些超级简单的东西吗?