Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

timer stop button

 عمل مؤقت يتوقف بضغط الزر مميز وتنسيق وقت محلي
<p id="demo"></p>

<button onclick="myStop()">Stop the time</button>

<script>
const myInterval = setInterval(myTimer, 1000);

function myTimer() {
  const date = new Date();
  document.getElementById("demo").innerHTML = date.toLocaleTimeString();
}

function myStop() {
  clearInterval(myInterval);
}
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: linear search algorithm in javascript 
Javascript :: react set state before render 
Javascript :: postfix date javascript 
Javascript :: cai nodejs ubuntu 
Javascript :: webpack test js or jsx 
Javascript :: comparare due array di numeri javascript 
Javascript :: res.write image url 
Javascript :: leaflet core 
Javascript :: nodejs express routing get 
Javascript :: javascript variable as object key 
Javascript :: delete cookie 
Javascript :: how to disable eval in javascript 
Javascript :: Swap a select text with javascript 
Javascript :: react icons cdn 
Javascript :: js .length 
Javascript :: javascript target closest 
Javascript :: javascript prototype example 
Javascript :: how to call javascript function with parameter in c# 
Javascript :: date format in angular ts 
Javascript :: getters and setters javascript 
Javascript :: react hook form with controlled input 
Javascript :: outputstream to image js example 
Javascript :: joi not empty string 
Javascript :: vue back image 
Javascript :: Loading react circular progress 
Javascript :: string to char code array javascript 
Javascript :: remove string character in center javascript 
Javascript :: react-intersection-observer 
Javascript :: active class always appear in navlink 
Javascript :: Custom delay function for waitfor puppeteer 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =