Sometimes you need data available to your scripts on the front end that you can normally only get from the server side of WordPress. Fortunately WordPress provides a relatively simple way to do this.
Native HTML 5 datepickers are great, they offer a simple to use interface (that works particularly well on mobile) plus they’re dead simple, just stick a
[type=date] attribute on a
<input> element and away you go. However, not all browsers support this so and will simply fall back to
[type=text] so a fallback is required for unsupported browsers…
Just a quick code snippet to show how to show/hide html elements based on the active
option in a