I'm trying to append the jQuery ui-datepicker and I can't get the event handler working:
$( '.ui-datepicker' ).on('click', 'a.ui-datepicker-next', 'a.ui-datepicker-prev', function( event ) {
event.preventDefault();
console.log("CLICK");
});
I've got nothing logging to the console when I click the links. Here is the html:
<div id="ui-datepicker-div" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"...>
<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix- ui-corner-all">
<a class="ui-datepicker-next ui-corner-all"...></a>
<a class="ui-datepicker-prev ui-corner-all"...></a>
...
What do I need to put as the event handler to trigger this? The jQuery is in a <script>jQuery here</script> in the footer of my html.
EDIT: links were incorrect - a.ui-datepicker-month and a.ui-datepicker-year changed to a.ui-datepicker-next and a.ui-datepicker-prev
Thanks