h5实现软键盘搜索功能
//必须带上action
<form action="" id="form">
<div>
<span class="icon-search"></span>
<input type="search" value="" placeholder="找不到?不妨搜一下..." id="searchTxt">
<span id="delete"></span>
</div>
</form>
$("#form").submit(function(e){
e.preventDefault();//阻止默认刷新
keyword=$('#searchTxt').val()
if($('#searchTxt').val().length>0){
$('#search-list').html('')
$('#search-list-box').show()
$('#wrapper').hide()
pageSearch=1
getSearchList()
console.log('search click')
}
})
input:-internal-autofill-previewed,
input:-internal-autofill-selected {
-webkit-text-fill-color: #FFFFFF !important;
}
//去除默认样式
input[type="search"]::-webkit-search-cancel-button{
-webkit-appearance: none;
}
本文标题:h5实现软键盘搜索功能
本文链接:https://www.haomeiwen.com/subject/gjmfjktx.html
网友评论