Basic form
The most common calendar usage is to select a calendar date. That's why .datepicker
is typically set to a text field, meant for the date input. In this case, the calendar will appear when this text field receives focus, and disappear when it looses the focus or when you select a specific date on the calendar (chosen date, thus, will be provided in the text box).
<p> <label>Date:</label> <input type="text" class="datepicker"> </p>