<script>
  let y = 0
  let x = document.querySelector("p")
  setInterval(function(){y++; x.innerHTML = y},1000)
  x.addEventListener("change",change)
  function change(){console.log("i have changed")}
</script>
the script above is kind of what i'm looking for, this has worked for a input element, but i want a this kind of solution, however i am aware it might not be possible, thank you.