I am using bootstrap datepicker inline, when i click on a year
, it is fine as i see ciao in console
, however, when I click on prev
or next
, and then I click
on a year, console
is not showing ciao. I have tried a lot of different things, one of which is the following and goDateClick()
is firing but not the click event
within it
goDateClick();
$("#sandbox-container .prev").on("click", function(e) {
goDateClick();
});
$("#sandbox-container .next").on("click", function(e) {
goDateClick();
});
function goDateClick() {
$("#sandbox-container span").on("click", function(e) {
console.log("ciao");
});
};
Try it, click a year and it's fine, click next or prev and the year won't show up
I have tried the suggested answer as per "duplicated" and it doesn't work check http://jsfiddle.net/vwmHF/281/