【问题标题】:Open html5 datepicker on input click在输入点击时打开 html5 日期选择器
【发布时间】:2021-11-02 16:13:33
【问题描述】:

默认情况下,单击图标时会打开日期选择器。

现在,我希望在单击输入字段时出现日期选择器。 我可以通过将图标放大到 100% 宽度来实现这一点,但我不能让它透明,所以根本没有图标,只有文本可见......

我想我前几天已经看到了解决方案,但现在,我什么也没找到。

我怎样才能得到想要的效果? PS:onFocus 解决方案会比 onClick 更好。

input#modified::-webkit-calendar-picker-indicator {
  width: 100%;
  margin: 0;
  border: 1px solid red;
  background: none;
}
Normal: only icon-click shows datepicker 
<input type="datetime-local" ><br>
Modified: click red outline for datepicker
<input type="datetime-local" id="modified">

【问题讨论】:

标签: html css input datepicker


【解决方案1】:

This 为我工作。 这是我以前见过但没有找到的答案。

【讨论】:

    猜你喜欢
    • 2020-10-26
    • 2013-08-22
    • 2014-10-26
    • 2021-02-11
    • 2023-01-31
    • 2014-01-05
    • 1970-01-01
    • 1970-01-01
    • 2018-04-06
    相关资源
    最近更新 更多