Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
jquery .addclass and remove class is not working

on my code i have a button and if the user clicks the button i try to change a timer which displays on ui by 20 minutes

this was my ui code

enter image description here

this was the function where the user clicks the button then it will get called and following lines get executed

$('input[name$="timer[1]"').addClass('increaseTimer').removeClass('inputTimer');

The class name gets changed while clicking the button, but the timer is not getting increased

the UI shows the time of input timer class

Increase timer code:


$(".increaseTimer").datetimepicker({

  ignoreReadonly:true,

  format: 'LT',

  defaultDate: genDate()+' 00:20'

});

Input timer code:

$(".inputTimer").datetimepicker({

  ignoreReadonly:true,

  format: 'LT',

  defaultDate: genDate()+' 00:00'

});

the increase timer is working only if the input timer is not used in UI itself, at that time the increase timer is applying while clicking the button

the remove class is applied , but the UI shows the timer and it not get removed from UI

What wrong in my code

please helpme out

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!