簡體   English   中英

jQuery 日期選擇器 javascript 語法問題

[英]jQuery date-picker javascript syntax problem

錯誤試圖做一些簡單的事情,但我遇到了錯誤,我是初學者,所以我有很多語法問題。 謝謝你!

 <input class="DateFrom" placeholder="min 7 days"> <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js" integrity="sha256-e9gNBsAcA0DBuRWbm0oZfbiCyhjLrI6bmqAl5o+ZjUA=" crossorigin="anonymous"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js" integrity="sha256-PsB+5ZEsBlDx9Fi/GXc1bZmC7wEQzZK4bM/VwNm1L6c=" crossorigin="anonymous"></script> <script type="text/javascript"> $("input.DateFrom").datepicker({ minDate: 7, dateFormat: 'dd/mm/y',//check change changeMonth: true, changeYear: true }); </script> </body>

嘗試這個,

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "input.DateFrom" ).datepicker( {
    minDate: 7,
    dateFormat: 'dd/mm/y',
    changeMonth: true,
    changeYear: true
    });
  } );
  </script>
</head>
<body>
<p>Date: <input type="text" class="DateFrom"></p>
</body>
</html>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM