my secondsInput is going past 0
i don't know what am doing wrong
9 Replies
Try
--secondsInput.value
ok let me try
@vince not working
I want it to stop when the countdown hit 0
.value
is always a string, and a string will never triple-equal a number:the easiest fix is to change
===
to ==
and !==
to !=
an alternative is to wrap all the .value's you use for comparison in parseInt: parseInt(hoursInput.value) === 0
ok but can't I use parsInt to convert it to
oops
let try with pareInt
@jochemm it worked thanks God bless you almost 5hr on just this but
never giving up
glad to help 🙂
instead of
hoursInput.value
you could also have done hoursInput.valueAsNumber
it will already convert to number in one go@markboots. like this Number(hoursInput.value)?