Clicking button opens page X until after countdown the open page Y
I am making this surprise website for my wife, it consists of the index page being a countdown until a certain date. with 1 button that opens the gift. now i want the button to either be locked until the countdown is done, or if possible have it open a page where i tease here like "oh no you dont" but if the timer is at 0 then the actual prize would open. if that makes any sense 😅. either or way of it working would be amazing.
here is my code pen for easier debug and preview: https://codepen.io/Probler/pen/KKLJxqO
enter code here
if this isnt the right place to ask then im sorry! but if you could redirect me where i should be that would be helpful.
2
Answers
If I understood correctly what you want. So:
You need first thing to create 2 HTML pages one for surprise. and the second to ‘ho no…’
Then change the button to:
and create the function in JS:
Full code:
I just needed to perform a little DOM manipulation to add a functional onClick directly when the timer reaches zero.
to
and
to