在頁面加載的時(shí)候自動為日期插件添加當(dāng)前日期。
1
2
3
4
5
|
<script type= "text/javascript" > $(document).ready( function (){ $( "#startTime" ).val(formatDate()); $( "#endTime" ).val(formatDate()); } |
jsp頁面的body部分代碼:
1
2
|
< td >< label >日期:</ label ></ td > < td >< input type = "text" id = "startTime" >至:< input type = "text" id = "endTime" ></ td > |