i have no clue how to preform javascript loops all i want to do is simply update the code below every second so it provides the correct time after the user presses the button
<button type="button"
onclick="document.getElementById('time').innerHTML = Date()">
Click me to display Date and Time.</button>
<p id="demo"></p>
what are some ways that could be used to make it run every second but not require the user to press the button more than once
` to `time`
– Taki Apr 12 '21 at 15:31