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

177
Views
refresh my current time on each 6 seconds

I want to refresh div on each 6 second? I am using this code but why my time is not refreshing ? after page reload it shows current time.

setInterval(function() {
          var d = new Date(),        
            h = d.getHours(),
            m = d.getMinutes();
              if(h < 10) h = '0' + h; 
              if(m < 10) m = '0' + m;
                      
              $('input[type="time"][value="now"]').each(function(){ 
                $(this).attr({'value': h + ':' + m});
              });
       }, 3000);
        
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

because after first change inupt value changed, $('input[type="time"][value="now"]') is not working because there is no input tag has value "now"

try this

setInterval(function() {
          var d = new Date(),        
            h = d.getHours(),
            m = d.getMinutes();
              if(h < 10) h = '0' + h; 
              if(m < 10) m = '0' + m;
                      
              $('input[type="time"]').each(function(){ 
                $(this).attr({'value': h + ':' + m});
              });
       }, 3000);
about 4 years ago · Juan Pablo Isaza Report
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!