RyeGuy RyeGuy - 5 months ago 17
jQuery Question

Element text content not changing on click

I am attempting to make a functional timer that counts down from 15 or 30. However I cannot get to the text value to change upon click of the 15 button. Can someone diagnose this issue?

Thanks in advance


<h1 id="timer"><time>00</time></h1>
<button id="fifteen">15 sec</button>

JavaScript or Jquery

var fifteen = document.getElementById('timer');

fifteen.onclick = fifteenRollback();

function fifteenRollback(){
h1.textcontent = "15";


Just do it using mentioned jQuery library:

$('#fifteen').on('click', function() {