Need help, tow sliders to an on/off control

What you are doing is close, but you can’t use the setInterval timer as that one runs constantly. You want to use a different type of timer.

Perhaps look at this post… particularly the Latch and Indicator use of the setTimout timer… and use your slider to supply the time portion as in your current code.