我有Bootstrap Datepicker,並且我想在點擊Set Date
按鈕時設置默認日期。如何從Bootstrap Datepicker點擊選擇日期
HTML
<div class="input-append date datepicker no-padding" data-date-format="dd-mm-yyyy">
<input class="input-medium" id="date" size="16" type="text"><span class="add-on"><i class="icon-th"></i></span>
</div>
<a href="#" id="set_date">Set Date</a>
jQuery的
$(document).ready(function() {
$('.datepicker').datepicker();
$("#set_date").click(function(){
date ="07/01/2015";
$("#date").val(date);
});
});
我設置使用jQuery
日期,但它不會顯示爲選定的日期。我的問題是如何設置date
點擊並顯示爲選定的日期。
非常感謝!它工作正常。 – Sadikhasan
不客氣 – robert