Question
I have the following HTML code. I what the timer to start and display when lockUV button is clicked. And to stop it on UV
I have the following HTML code. I what the timer to start and display when "lockUV" button is clicked. And to stop it on "UV not done". I belive the code has eveything to make this work but its not doing it.
code
KMOG U.I.
var x = document.getElementById("ui");
var interval; function countdown(){ clearInterval(interval); interval=setInterval(function(){ var timer = $('.js-timeout').html(); timer = timer.split(':'); var minutes = timer[0]; var seconds = timer[1]; seconds -=1; if (minutes <0) reurn; else if (seconds <0 && minutes !=0){ minutes -=1; seconds = 59; } else if (seconds <10 && length.seconds !=2) seconds = '0' + seconds; $('.js-timeout').html(minutes + ':' + seconds); if (minutes == 0 && seconds == 0) clearInterval(interval); },1000); } $('#js-startTimer').click(function () { $('.js-timeout').text("2:00"); countdown(); }); $('#js-resetTimer').click(function(){ $('.js-timeout').text("2:00"); clearInterval(interval); }); function ChangState() {
x.innerHTML = "Message: A driver has picked up your order and is on rout to your location has been sent to user"; clear();//call function clear()
}
//function confirm1()
function confirm1()
{
x.innerHTML ="Message: UV box is not done has been sent to user"; clear();
}
//function confirm2()
function confirm2()
{
x.innerHTML ="A driver has picked up your order and is on rout to your location"; clear(); }
//function to clear message
function clear()
{
setTimeout( function(){x.innerHTML="";}, 5000);
return false;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started