my secondsInput is going past 0

i don't know what am doing wrong
9 Replies
vince
vince16mo ago
Try --secondsInput.value
vert_Nk26☑
vert_Nk26☑16mo ago
ok let me try @vince not working I want it to stop when the countdown hit 0
Jochem
Jochem16mo ago
.value is always a string, and a string will never triple-equal a number:
Jochem
Jochem16mo ago
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
vert_Nk26☑
vert_Nk26☑16mo ago
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
Jochem
Jochem16mo ago
glad to help 🙂
MarkBoots
MarkBoots16mo ago
instead of hoursInput.value you could also have done hoursInput.valueAsNumber it will already convert to number in one go
vert_Nk26☑
vert_Nk26☑16mo ago
@markboots. like this Number(hoursInput.value)?