gpt4 book ai didi

javascript - 样式化日期时间-本地日历清除按钮

转载 作者:行者123 更新时间:2023-12-05 04:39:58 24 4
gpt4 key购买 nike

有没有办法从 html5 日期时间选择器附带的日历弹出窗口中设置或删除此清除按钮?它没有清除我的字段,并且想删除或编辑它,因为它无法正常工作。

enter image description here

这里是输入的html

<label for="rowKeyStartDate">Start Date/Time: </label>
<mat-form-field appearance="outline">
<input matInput id="rowKeyStartDate" type="datetime-local" step="0.001" formControlName="rowKeyStartDate" required>
</mat-form-field>

最佳答案

Clear 按钮隐含的一种工作方式是添加一个隐藏的 <button>元素:

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Test Application</title>
<link rel="stylesheet" href="style.css">
</head>

<body>
<input id="el" type="datetime-local">
<button onclick="javascript:el.value=''" hidden></button>
</body>
</html>

关于javascript - 样式化日期时间-本地日历清除按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70365987/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com