如何在jQuery中清除DatePicker的历史记录 [英] How to clear history of DatePicker in jQuery

查看:870
本文介绍了如何在jQuery中清除DatePicker的历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个jQuery Date Pickers,但是当我将光标放在每个日期选择器中时,以前选择的所有日期都显示为一个列表.

I have two jQuery Date Pickers but when I put the cursor inside each of the date-pickers, all dates that were previously selected are shown as a list.

我想清除以前选择的所有日期.

I want to clear all those dates that were previously selected.

有帮助吗?

推荐答案

您正在寻找的东西称为自动完成 您可以在 MDN W3C

What you are looking for is called autocomplete You can learn about this attr in MDN or W3C

VIA HTML:

<input type="text" class="datepicker" id="myid" autocomplete="off">

VIA JQUERY

VIA JQUERY

$('.datepicker').on('click', function(e) {
e.preventDefault();
$(this).attr("autocomplete", "off");  
});

通过JQUERY ALL DATEPICKERS(名为.datepicker的类)

VIA JQUERY ALL DATEPICKERS (class named .datepicker)

$(".datepicker").attr("autocomplete", "off");

这篇关于如何在jQuery中清除DatePicker的历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆