1.
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> 5 <title>日期插件使用</title> 6 <style type="text/css"> 7 img { 8 border:none; 9 } 10 address, caption, cite, code, dfn, em, th, var { 11 font-style:normal; 12 font-weight:400; 13 } 14 ol, ul { 15 list-style:none; 16 } 17 h1, h2, h3, h4, h5, h6 { 18 font-size:100%; 19 } 20 body { 21 font-family:Arial,Helvetica,sans-serif,SimSun,"宋体"; 22 font-size:12px; 23 color:#666666; 24 background:#FFFFFF 25 } 26 </style> 27 <style type="text/css">@import "jquery.datepick.css";</style> 28 <script src="../jquery-1.5.2.js" type="text/javascript"> 29 </script> 30 <script src="../jquery.datepick.js" type="text/javascript"> 31 </script> 32 <!--下面一行是汉化JS文件--> 33 <script src="../jquery.datepick-zh-CN.js" type="text/javascript"> 34 </script> 35 <script type="text/javascript"> 36 $(document).ready( function() { 37 $('#datepicker').datepick({dateFormat: 'yy-mm-dd'}); 38 alert($('#datepicker').val()); 39 }); 40 </script> 41 </head> 42 <body> 43 <div class="demo"> 44 Date: <input type="text" name="time" value="2009-2-9" id="datepicker" /> 45 </div> 46 </body> 47 </html>