HTML input 标签 date 类型 设置默认值
<div class="am-u-sm-9">
<input id="defaultdate" required="" placeholder="请选择日期" value="{{defaultdate|date:"Y-m-d"|default_if_none:""}}" name="defaultdate" type="date">
</div>
<script language="JavaScript">
<!--设置默认值 -->
<!--var defaultdate = "2022-01-02" -->;
<!--通过传入参数设置默认值 -->
var defaultdate = "{{defaultdate}}";
$(document).ready(function(){
$('#defaultdate').val(defaultdate);
})
</script>