I’m making a typing game and I need the user to be able to change the timer’s time using a button. ’30’ changes the timer to 30s, ’60’ changes the timer to 60s, so and so on.
JS:
var gameTime = (30) * 1000;
changing the value in the brackets changes the timer’s time(s).
HTML:
<button id=thirty type="submit" onClick="onClick=myFunction(this.value)">30s</button>
planning on having about 3 or 4 timer options.
How do I create a function in JS that does this? I would also need it to change the HTML title (>30s<) to its respected value.