Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/414.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript html输入字段中的jQuery datepicker默认值_Javascript_Jquery_Datepicker - Fatal编程技术网

Javascript html输入字段中的jQuery datepicker默认值

Javascript html输入字段中的jQuery datepicker默认值,javascript,jquery,datepicker,Javascript,Jquery,Datepicker,输入字段中的jQuery日期选择器默认值(今天) 试试: 使用setDate和new Date()设置当前日期 $('#datepicker').datepicker().datepicker('setDate','today') 试试这个 $(function () { var currentDate = new Date(); $('#datepicker').datepicker({ inline

输入字段中的jQuery日期选择器默认值(今天)

试试:

使用
setDate
new Date()
设置当前日期

$('#datepicker').datepicker().datepicker('setDate','today')

试试这个

  $(function () {
             var currentDate = new Date();
             $('#datepicker').datepicker({
                 inline: true,
                 showOtherMonths: true,
                 dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
                 dateFormat: 'dd/mm/yy'
             });
             $("#datepicker").datepicker("setDate", currentDate);
         })
Html代码

     <tr>
        <td width="190"><input style="width: 85px; color:#27AAE1; font-weight: bold; font-family: Arial, Helvetica, sans-serif; font-size: 0.8em;" type="text" id="datepicker" /></td>
    </tr>
</table>


我对目前的jQ版本不满意。找到另一个解决方案<代码>$('#datepicker').datepicker().datepicker('setDate','0')