my secondsInput is going past 0

i don't know what am doing wrong
9 Replies
vince
vince2y ago
Try --secondsInput.value
vert_Nk26☑
vert_Nk26☑2y ago
ok let me try @vince not working I want it to stop when the countdown hit 0
Jochem
Jochem2y ago
.value is always a string, and a string will never triple-equal a number:
Jochem
Jochem2y 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☑2y 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
Jochem2y ago
glad to help 🙂
MarkBoots
MarkBoots2y 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☑2y ago
@markboots. like this Number(hoursInput.value)?
Want results from more Discord servers?
Add your server