我想设置日期。我使用了 .val() 函数,但它在 android 中不起作用。
<input name="caseDate" id="caseDate" min="2000-01-01" value="" type="date" class="caseDate_h" >
JS:
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
$('#caseDate').val(today);
$("#caseDate").attr("value", today);