Reputation: 41
datetimepicker is not working
I have a website where if the user clicks the button, then the timer which displays in the UI will get changed by 20 minutes, but when I do that it is not working.
Here is my code:
Function called while clicking the button.
I done this by removing previous timer class and added new timer class for increasing the timer.
function check(element) {
(('input[name$="timer[[1]]"').addClass('increaseTimer').removeClass('inputTimer'));
}
My input element:
Input timer code:
$(".increaseTimer").datetimepicker({
ignoreReadonly:true,
format: 'LT',
defaultDate: genDate()+' 00:20'
});
Increase timer code:
$(".inputTimer").datetimepicker({
ignoreReadonly:true,
format: 'LT',
defaultDate: genDate()+' 00:00'
});
While inspecting, the class name has been changed but it doesn't change the timer in the UI, but the same code works if I removed the inputtimer from the input type like this:
after that when I click the button then it calls the increase timer function and increases the timer by 20.
So what is wrong in my code?
Upvotes: 0
Views: 252