我试图将日期datePicker
放在 JavaScript 变量中,但变量的内容显示[object Object]
. 你能告诉我为什么吗?
这是代码:
<script type="text/javascript" src="../js/jquery-1.9.0.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.10.0.custom.min.js"></script>
<link href="datepicker.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
$(function(){
$('#datepicker').datepicker({
inline: true,
showOtherMonths: true,
altFormat: 'dd-mm-yy'
});
});
</script>
<script type="text/javascript">
var x = $('#datepicker').datepicker("getDate");
alert(x);
</script>