Reputation: 2123
HTML
<input type="text" class="datepicker01">
<input type="text" class="datepicker02">
I have 2 input that opens the datepicker.I want to add class to the datepicker which opened in the second input (class="datepicker2"). How can I do this?
http://jsbin.com/cixubuto/1/edit
Upvotes: 1
Views: 4425
Reputation: 1010
According to the docs you can set a beforeShow option:
$('.datepicker01').datepicker(
{
beforeShow: function( input, inst){
$(inst.dpDiv).addClass('aa');
}
}
);
Upvotes: 5
Reputation: 256
Try the below , No need to bother about datepicker , considering it as normal jquery selector only, you can solve this issue :
$('.datepicker01').datepicker();
$('.datepicker02').datepicker();
$('.datepicker02').addClass('ClassName');
Upvotes: -2