
<!doctype html>
<html class="no-js" lang="en-US">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">

	<title>Datepicker | jQuery UI</title>

	<meta name="author" content="OpenJS Foundation - openjsf.org">
	<meta name="description" content="jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.">
	<meta name="viewport" content="width=device-width">

	<link rel="shortcut icon" href="https://jqueryui.com/wp-content/themes/jqueryui.com/i/favicon.ico">
	<link rel="stylesheet" href="https://jqueryui.com/wp-content/themes/jquery/lib/typesense-minibar/typesense-minibar.css">
	<link rel="stylesheet" href="https://jqueryui.com/wp-content/themes/jquery/css/base.css?v=15">
	<link rel="stylesheet" href="https://jqueryui.com/wp-content/themes/jqueryui.com/style.css?v=8">

	<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
	<script src="https://jqueryui.com/wp-content/themes/jquery/js/main.js"></script>
<meta name='robots' content='max-image-preview:large' />
<link rel="https://api.w.org/" href="https://jqueryui.com/wp-json/" /><link rel="alternate" type="application/json" href="https://jqueryui.com/wp-json/wp/v2/pages/24" /><meta name="generator" content="WordPress 6.5.4" />
<link rel="canonical" href="https://jqueryui.com/datepicker/" />
<link rel="alternate" type="application/json+oembed" href="https://jqueryui.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fjqueryui.com%2Fdatepicker%2F" />
<link rel="alternate" type="text/xml+oembed" href="https://jqueryui.com/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fjqueryui.com%2Fdatepicker%2F&#038;format=xml" />
</head>
<body class="jquery-ui page-template-default page page-id-24 page-slug-datepicker single-author singular">

<header>
	<section id="global-nav">
		<nav>
			<div class="constrain">
				<ul class="projects">
					<li class="project jquery"><a href="https://jquery.com/" title="jQuery">jQuery</a></li>
					<li class="project jquery-ui"><a href="https://jqueryui.com/" title="jQuery UI">jQuery UI</a></li>
					<li class="project jquery-mobile"><a href="https://jquerymobile.com/" title="jQuery Mobile">jQuery Mobile</a></li>
					<li class="project sizzlejs"><a href="https://sizzlejs.com/" title="Sizzle">Sizzle</a></li>
					<li class="project qunitjs"><a href="https://qunitjs.com/" title="QUnit">QUnit</a></li>
				</ul>
				<ul class="links">
					<li><a href="https://plugins.jquery.com/">Plugins</a></li>
					<li class="dropdown"><a href="https://contribute.jquery.org/">Contribute</a>
						<ul>
							<li><a href="https://cla.openjsf.org/">CLA</a></li>
							<li><a href="https://contribute.jquery.org/style-guide/">Style Guides</a></li>
							<li><a href="https://contribute.jquery.org/triage/">Bug Triage</a></li>
							<li><a href="https://contribute.jquery.org/code/">Code</a></li>
							<li><a href="https://contribute.jquery.org/documentation/">Documentation</a></li>
							<li><a href="https://contribute.jquery.org/web-sites/">Web Sites</a></li>
						</ul>
					</li>
					<li class="dropdown"><a href="https://events.jquery.org/">Events</a>
						<ul class="wide">
						</ul>
					</li>
					<li class="dropdown"><a href="https://jquery.com/support/">Support</a>
						<ul>
							<li><a href="https://learn.jquery.com/">Learning Center</a></li>
							<li><a href="https://jquery.com/support/">Chat</a></li>
							<li><a href="https://stackoverflow.com/tags/jquery/info">Stack Overflow</a></li>
							<li><a href="https://contribute.jquery.org/bug-reports/">Report a bug</a></li>
						</ul>
					</li>
					<li class="dropdown"><a href="https://openjsf.org/">OpenJS Foundation</a>
						<ul>
							<li><a href="https://openjsf.org/about/join/">Join</a></li>
							<li><a href="https://openjsf.org/about/members/">Members</a></li>
							<li><a href="https://jquery.com/team">jQuery Team</a></li>
							<li><a href="https://openjsf.org/about/governance/">Governance</a></li>
							<li><a href="https://code-of-conduct.openjsf.org/">Conduct</a></li>
							<li><a href="https://openjsf.org/about/project-funding-opportunities/">Donate</a></li>
						</ul>
					</li>
				</ul>
			</div>
		</nav>
	</section>
</header>

<div id="container">
	<div id="logo-events" class="constrain clearfix">
		<h2 class="logo"><a href="/" title="jQuery UI">jQuery UI</a></h2>

		<aside id="broadcast"></aside>
	</div>

	<nav id="main" class="constrain clearfix">
		<div class="menu-top-container">
	<button hidden id="menu-trigger" class="button menu-trigger" aria-expanded="false" aria-haspopup="menu">Navigation</button>
	<ul id="menu-top" class="menu" role="menu" aria-labelledby="menu-trigger">
<li class="menu-item"><a href="https://jqueryui.com/demos/">Demos</a></li>
<li class="menu-item"><a href="https://jqueryui.com/download/">Download</a></li>
<li class="menu-item"><a href="https://api.jqueryui.com/">API Documentation</a></li>
<li class="menu-item"><a href="https://jqueryui.com/themeroller/">Themes</a></li>
<li class="menu-item"><a href="https://jqueryui.com/development/">Development</a></li>
<li class="menu-item"><a href="https://jqueryui.com/support/">Support</a></li>
<li class="menu-item"><a href="https://blog.jqueryui.com/">Blog</a></li>
<li class="menu-item"><a href="https://jqueryui.com/about/">About</a></li>
	</ul>
</div>

		<form role="search" class="searchform tsmb-form" action="https://jqueryui.com/" method="get"	data-origin="https://typesense.jquery.com"
	data-collection="jqueryui_com"
	data-key="Zh8mMgohXECel9wjPwqT7lekLSG3OCgz"
	data-foot="true" data-group="true"
>
	<input type="search" name="s" aria-label="Search jQuery UI" value="" placeholder="Search" autocomplete="off">
	<button type="submit" class="visuallyhidden"></button>
</form>
	</nav>

	<div id="content-wrapper" class="clearfix row">


<div class="content-right twelve columns">
	<div id="content">
				<h1 class="entry-title">Datepicker</h1>
		<hr>
		
		
<p class="desc">Select a date from a popup or inline calendar</p>

<div class="demo-list"><h2>Examples</h2><ul><li class="active"><a href="/resources/demos/datepicker/default.html">Default functionality</a></li><li><a href="/resources/demos/datepicker/animation.html">Animations</a></li><li><a href="/resources/demos/datepicker/other-months.html">Dates in other months</a></li><li><a href="/resources/demos/datepicker/buttonbar.html">Display button bar</a></li><li><a href="/resources/demos/datepicker/inline.html">Display inline</a></li><li><a href="/resources/demos/datepicker/dropdown-month-year.html">Display month & year menus</a></li><li><a href="/resources/demos/datepicker/multiple-calendars.html">Display multiple months</a></li><li><a href="/resources/demos/datepicker/date-formats.html">Format date</a></li><li><a href="/resources/demos/datepicker/icon-trigger.html">Icon trigger</a></li><li><a href="/resources/demos/datepicker/localization.html">Localize calendar</a></li><li><a href="/resources/demos/datepicker/alt-field.html">Populate alternate field</a></li><li><a href="/resources/demos/datepicker/min-max.html">Restrict date range</a></li><li><a href="/resources/demos/datepicker/date-range.html">Select a Date Range</a></li><li><a href="/resources/demos/datepicker/show-week.html">Show week of the year</a></li></ul></div><iframe src="/resources/demos/datepicker/default.html" class="demo-frame"></iframe><div class="demo-description">
<p>The datepicker is tied to a standard form input field.  Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay.  Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.</p>
</div><div class="view-source"><a tabindex="0"><i class="icon-eye-open"></i> view source</a><div><div class="syntaxhighlighter xml">
	<table>
		<tbody>
			<tr>
				
				<td class="gutter">
					
						<div class="line n1">1</div>
					
						<div class="line n2">2</div>
					
						<div class="line n3">3</div>
					
						<div class="line n4">4</div>
					
						<div class="line n5">5</div>
					
						<div class="line n6">6</div>
					
						<div class="line n7">7</div>
					
						<div class="line n8">8</div>
					
						<div class="line n9">9</div>
					
						<div class="line n10">10</div>
					
						<div class="line n11">11</div>
					
						<div class="line n12">12</div>
					
						<div class="line n13">13</div>
					
						<div class="line n14">14</div>
					
						<div class="line n15">15</div>
					
						<div class="line n16">16</div>
					
						<div class="line n17">17</div>
					
						<div class="line n18">18</div>
					
						<div class="line n19">19</div>
					
						<div class="line n20">20</div>
					
						<div class="line n21">21</div>
					
						<div class="line n22">22</div>
					
				</td>
				
				<td class="code">
					<pre><div class="container"><div class="line"><code><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span><span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"utf-8"</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1"</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>jQuery UI Datepicker - Default functionality<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"https://code.jquery.com/ui/1.13.3/themes/base/jquery-ui.css"</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/resources/demos/style.css"</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://code.jquery.com/jquery-3.7.1.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://code.jquery.com/ui/1.13.3/jquery-ui.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="javascript"></span></code></div></div><div class="container"><div class="line"><code>  $( <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{</code></div></div><div class="container"><div class="line"><code>    $( <span class="hljs-string">"#datepicker"</span> ).datepicker();</code></div></div><div class="container"><div class="line"><code>  } );</code></div></div><div class="container"><div class="line"><code>  <span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Date: <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"datepicker"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span></code></div></div></pre>
				</td>
			</tr>
		</tbody>
	</table>
</div>
</div></div>

<p>Want to learn more about the datepicker widget? Check out the
<a href="https://api.jqueryui.com/datepicker/">API documentation</a>.</p>	</div>
	<div id="sidebar" class="widget-area" role="complementary">
	<aside class="widget">
		<h3 class="widget-title">Interactions</h3>
		<ul>
			<li><a href="https://jqueryui.com/draggable/">Draggable</a></li><li><a href="https://jqueryui.com/droppable/">Droppable</a></li><li><a href="https://jqueryui.com/resizable/">Resizable</a></li><li><a href="https://jqueryui.com/selectable/">Selectable</a></li><li><a href="https://jqueryui.com/sortable/">Sortable</a></li>		</ul>
	</aside>
	<aside class="widget">
		<h3 class="widget-title">Widgets</h3>
		<ul>
			<li><a href="https://jqueryui.com/accordion/">Accordion</a></li><li><a href="https://jqueryui.com/autocomplete/">Autocomplete</a></li><li><a href="https://jqueryui.com/button/">Button</a></li><li><a href="https://jqueryui.com/checkboxradio/">Checkboxradio</a></li><li><a href="https://jqueryui.com/controlgroup/">Controlgroup</a></li><li><a href="https://jqueryui.com/datepicker/">Datepicker</a></li><li><a href="https://jqueryui.com/dialog/">Dialog</a></li><li><a href="https://jqueryui.com/menu/">Menu</a></li><li><a href="https://jqueryui.com/progressbar/">Progressbar</a></li><li><a href="https://jqueryui.com/selectmenu/">Selectmenu</a></li><li><a href="https://jqueryui.com/slider/">Slider</a></li><li><a href="https://jqueryui.com/spinner/">Spinner</a></li><li><a href="https://jqueryui.com/tabs/">Tabs</a></li><li><a href="https://jqueryui.com/tooltip/">Tooltip</a></li>		</ul>
	</aside>
	<aside class="widget">
		<h3 class="widget-title">Effects</h3>
		<ul>
			<li><a href="https://jqueryui.com/addClass/">Add Class</a></li><li><a href="https://jqueryui.com/animate/">Color Animation</a></li><li><a href="https://jqueryui.com/easing/">Easing</a></li><li><a href="https://jqueryui.com/effect/">Effect</a></li><li><a href="https://jqueryui.com/hide/">Hide</a></li><li><a href="https://jqueryui.com/removeClass/">Remove Class</a></li><li><a href="https://jqueryui.com/show/">Show</a></li><li><a href="https://jqueryui.com/switchClass/">Switch Class</a></li><li><a href="https://jqueryui.com/toggle/">Toggle</a></li><li><a href="https://jqueryui.com/toggleClass/">Toggle Class</a></li>		</ul>
	</aside>
	<aside class="widget">
		<h3 class="widget-title">Utilities</h3>
		<ul>
			<li><a href="https://jqueryui.com/position/">Position</a></li><li><a href="https://jqueryui.com/widget/">Widget Factory</a></li>		</ul>
	</aside>
</div>
</div>

	</div>
</div>

<footer class="clearfix simple">
	<div class="constrain">
		<div class="row">
			<div class="six columns centered">
				<h3><span>Books</span></h3>
				<ul class="books">
					<li>
						<a href="https://www.manning.com/books/jquery-ui-in-action">
							<span><img src="https://jqueryui.com/wp-content/themes/jquery/content/books/jquery-ui-in-action.jpg" alt="jQuery UI in Action by TJ VanToll" width="92" height="114"></span>
							<strong>jQuery UI in Action</strong><br>
							<cite>TJ VanToll</cite>
						</a>
					</li>
					<li>
						<a href="https://www.packtpub.com/web-development/jquery-ui-themes-beginners-guide">
							<img src="https://jqueryui.com/wp-content/themes/jquery/content/books/jquery-ui-themes.jpg" alt="jQuery UI Themes by Adam Boduch" width="92" height="114">
							<span class="book-title">jQuery UI Themes</span>
							<cite>Adam Boduch</cite>
						</a>
					</li>
					<li>
						<a href="https://www.packtpub.com/web-development/jquery-ui-cookbook">
							<img src="https://jqueryui.com/wp-content/themes/jquery/content/books/jquery-ui-cookbook.jpg" alt="jQuery UI Cookbook by Adam Boduch" width="92" height="114">
							<span class="book-title">jQuery UI Cookbook</span>
							<cite>Adam Boduch</cite>
						</a>
					</li>
				</ul>
			</div>
		</div>

		
<div id="legal" class="legal">
	<ul class="footer-site-links">
			<li><a class="icon-pencil" href="https://learn.jquery.com/">Learning Center</a></li>
			<li><a class="icon-comments" href="https://jquery.com/support/">Chat</a></li>
			<li><a class="icon-twitter" href="https://twitter.com/jqueryui">Twitter</a></li>
			<li><a class="icon-github" href="https://github.com/jquery">GitHub</a></li>
	</ul>
	<p class="copyright">
		Copyright 2024 <a href="https://openjsf.org/">OpenJS Foundation</a> and jQuery contributors. All rights reserved. See <a href="https://jquery.com/license/">jQuery License</a> for more information. The <a href="https://openjsf.org/">OpenJS Foundation</a> has registered trademarks and uses trademarks. For a list of trademarks of the <a href="https://openjsf.org/">OpenJS Foundation</a>, please see our <a href="https://trademark-policy.openjsf.org/">Trademark Policy</a> and <a href="https://trademark-list.openjsf.org/">Trademark List</a>. Trademarks and logos not indicated on the <a href="https://trademark-list.openjsf.org/">list of OpenJS Foundation trademarks</a> are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them. OpenJS Foundation <a href="https://terms-of-use.openjsf.org/">Terms of Use</a>, <a href="https://privacy-policy.openjsf.org/">Privacy</a>, and <a href="https://www.linuxfoundation.org/cookies">Cookie</a> Policies also apply.
	</p>
	<p><a href="https://www.digitalocean.com" class="do-link">Web hosting by Digital Ocean</a> | <a href="https://www.fastly.com/">CDN by Fastly</a> | <a href="https://wordpress.org/" class="wp-link">Powered by WordPress</a></p>
</div>

	</div>
</footer>

<script defer src="https://jqueryui.com/wp-content/themes/jquery/lib/typesense-minibar/typesense-minibar.js"></script>

</body>
</html>