将HTML日期输入设置为默认字符串



我正在尝试设置基于输入日期范围提取数据的图表,所以我想将开始和结束日期选择器的默认值设置为字符串(即"开始"one_answers"结束",而不是"mm/dd/yyyy"(。

我目前正在设置日期输入如下:

<input style="background-color: #2E2F30; color:white; height: 50px; width: 150px;" type="date" id="StartDateSelect">
<input style="background-color: #2E2F30; color:white; height: 50px; width: 150px;" type="date" id="EndDateSelect">
<button class="btn" style="background-color: #2E2F30; color:white; height: 50px; width: 50px;" id="RefreshButton" onclick="getDates()">></button>

使用onfocus属性

<input type="text" class="form-control" placeholder="Start" onfocus="(this.type='date')"/>

最新更新