作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
定义搜索框如果输入框有一些文字,输入框会显示一个清除按钮,如何获取清除按钮的点击事件?
<label for="search-mini">Search Input:</label>
<input type="search" name="search-mini" id="search-mini" value="" data-mini="true" />
最佳答案
输入type=search
增强了清晰 <a>
具有类 ui-input-clear
的 anchor 按钮。您可以将事件附加到该按钮,如下所示。
$(document).on('click', '.ui-input-clear', function () {
alert('text cleared');
});
关于jquery - 如何在jquery-mobile中获取搜索框的清除事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17620351/
我是一名优秀的程序员,十分优秀!