加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap – 如何在bootstrap 3中清除带有’x’的搜索

发布时间:2020-12-17 23:59:24 所属栏目:安全 来源:网络整理
导读:有一些麻烦的bootstrap,所以一些帮助将是真棒。谢谢 我想要的:(顶部) 我当前的代码: div class="form-group" input type="text" class="form-control" id="findJobTitle" name="findJobTitle" placeholder="Job Title,Keywords" onkeyup="showResult()" /
有一些麻烦的bootstrap,所以一些帮助将是真棒。谢谢

我想要的:(顶部)

我当前的代码:

<div class="form-group">
    <input type="text" 
           class="form-control" 
           id="findJobTitle" 
           name="findJobTitle" 
           placeholder="Job Title,Keywords" 
           onkeyup="showResult()"> 
</div>

当前屏幕截图:

解决方法

将图像(取消图标)与位置绝对,调整顶部和左侧的属性,并调用方法onclick事件,清除输入字段。
<div class="form-control">
    <input type="text" id="inputField" />
</div>
<span id="iconSpan"><img src="icon.png" onclick="clearInputField()"/></span>

在css中相应地定位跨度,

#iconSpan {
 position : absolute;
 top:1%;
 left :14%;
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读