あなたはから依存関係をダウンロードすることができます:ちょうど最初のリンクに移動して、あなたがダウンロードボタンが表示されるまでスクロールダウンhttps://jquery.com/download/
:からhttp://jqueryui.com/download/ とjQuery自体。あなたの好みのテーマを選択し、ダウンロードを押してください。 zipファイルを解凍し、リンク(href)とスクリプト(src)で(自分のコード内で)調べて、それを動作させるために何を含めるかを確認します。
もちろん、スタイリング(CSS)を含める必要はありませんが、使用する場合はzipファイルが付属しています。
コード:
<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="jquery-ui-1.12.1.custom/jquery-ui.css">
<link rel="stylesheet" href="jquery-ui-1.12.1.custom/jquery-ui.structure.css">
<link rel="stylesheet" href="jquery-ui-1.12.1.custom/jquery-ui.theme.css">
<script src="jquery-3.1.1.js"></script>
<script src="jquery-ui-1.12.1.custom/jquery-ui.js"></script>
<script>
$(function() {
$("#datepicker").datepicker(
{
minDate: new Date(2009, 10 - 1, 25),
maxDate: "now",
buttonText: "Select date",
dateFormat: 'yy-mm-dd',
showOn: "both"
});
});
</script>
</head>
<body>
<h3>My DateTimePicker</h3>
<p>Pick date:
<input type="text" id="datepicker">
</p>
</body>
</html>
PS:
$(function() {
// Handler for .ready() called. (This is shorter)
});
は同じ行います
$(document).ready(function() {
// Handler for .ready() called. (This is longer)
});
あなたのコード整頓 –
フィドルや実行可能なコードを提供してください私たちは問題を解決できるように..: - ) –
コードに括弧がありません。 – athi