Input
cooldownSeconds = 3, user clicks at t=0
Output
Label sequence: "Wait 3s" → "Wait 2s" → "Wait 1s" → "Ready". Button re-enables after 3 seconds.
Given an integer `cooldownSeconds`, build a cooldown button using HTML, CSS, and JavaScript. Render a button with `data-testid="cooldown-button"` and a label with `data-testid="cooldown-label"`. Initial state: button en...
index.htmlEditable templatestyles.cssEditable startermain.jsEditable startercooldownSeconds = 3, user clicks at t=0
Label sequence: "Wait 3s" → "Wait 2s" → "Wait 1s" → "Ready". Button re-enables after 3 seconds.
Persist the cooldown end time so the cooldown continues correctly after a page reload.