Javascript Second Counter
On my website, I am trying to count (and display) how many seconds (not minutes or hours) the user has been on my site. So, if they have been on it for 5 minutes, it will display 300, Not 5 minutes. I am Very Unexperienced with JavaScript, So please help. You can use the setInterval function to run another function as often as you choose. For example: var seconds = 0; var el = document.getElementById('seconds-counter'); function incrementSeconds() { seconds += 1; el.innerText = "You have been here for " + seconds + " seconds."; } var cancel = setInterval(incrementSeconds, 1000); <div id=