Answers for "get local time second javascript heure temps réel"

0

get local time second javascript heure temps réel

<body>
  <p>Il est <span id="time"></span>.</p>
  <button id="stop">Stop time</button>
<script>
    let hour = document.getElementById("time");
	let stop = document.getElementById("stop");
	let realTime = setInterval(clock, 1000);
	
	function clock(){
    	let d = new Date();
    	hour.innerHTML = d.toLocaleTimeString();
    	}
    stop.addEventListener ("click", arret);
    function arret() {
    	clearInterval(realTime);
    }
</script>
</body>
Posted by: Guest on October-16-2020

Code answers related to "get local time second javascript heure temps réel"

Code answers related to "Javascript"

Browse Popular Code Answers by Language