1. Problem background
My97DatePicker is opened by default in the system and needs to be assigned a value. Use its own startDate attribute to set it. Use the focus event when switching calendars. The result is Tested on Firefox browser, stuck phenomenon occurs.
2. Implementation source code
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>My97DatePicker默认赋值</title> <script type="text/javascript" src="js/jquery-1.12.3.js" ></script> <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script> <script> $(function(){ $("#startDate").val($("#initDate").val()); $("#startDate").off().on("focus",function(){ var startDate = $(initDate).val(); WdatePicker({startDate:startDate}); }); }); </script> </head> <body> <input type="text" id="initDate" value="2015-06-20"/><br><br> <input type="text" id="startDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"/> </body> </html>
3. Achievement results
##4. Problem description
The above is the content assigned by My97DatePicker by default. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!