<button id="btn">0</button>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic,700italic);

html,body {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg,  #EA5C54  0%,#bb6dec 100%);
}

button {
  color: #fff;
  font-size: 4vw;
  padding:20px 60px;
  outline: none;
  background-color: #27ae60;
  border: none;
  border-radius:5px;
  box-shadow: 0 9px #95a5a6;
  text-shadow: 2px 2px 0 rgba(0,0,0,.25),-2px -2px 0 rgba(0,0,0,.25);
  cursor: pointer;
}

button:hover{
  background-color: #2ecc71;
}

button:active {
  background-color: #2ecc71;
  box-shadow: 0 5px #95a5a6;
  transform: translateY(4px);
}
const btn = document.getElementById('btn')
let timer = setInterval(() => {
  btn.textContent = parseInt(btn.textContent) + 1 
}, 1000)

btn.addEventListener('click',() => {
  clearInterval(timer)
  btn.textContent = 0
}, false)
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.