jQuery how to event fire for todays date only?

I tried to fire event for today's date only. For a reason, I can't use Date picker onselect / onClose method.

Now I want to do it directly when just select todays date from datepicker. I'm using class for fire event. But now Working.

jQuery("td.ui-datepicker-today a").click(function(){ 
 //event trigger. 
});

Can anyone give me any suggestion ?

Upvotes: 1

Views: 188

Answers (2)

Joshi
Joshi

Reputation: 29

Jquery click event will not work with the elements that are dynamically added to dom. You need to use on or bind methods in jquery to achieve this.

Upvotes: 1

SAMUEL
SAMUEL

Reputation: 8552

You may try following

jQuery("body").on("click","td.ui-datepicker-today a",function(){ 
 //event trigger. 
});

Upvotes: 3

Related Questions