Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

show data time &refresh

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript setInterval()</h2>

<p>Using setInterval() to display the time every second (1000 milliseconds).</p>

<h1 id="demo"></h1>

<script>
setInterval(myFunction, 1000);

function myFunction() {
  let d = new Date();
  document.getElementById("demo").innerHTML=
  d.getHours() + ":" +
  d.getMinutes() + ":" +
  d.getSeconds();
}
</script>

</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: white for file loaded 
Javascript :: js undici 
Javascript :: Expresiones regulares para diferentes tipos de campos de formularios 
Javascript :: phaser3 simple player controll 
Javascript :: React "Nothing was returned from render Error" Solution 
Javascript :: nextjs check path 404 
Javascript :: site:stackoverflow.com two api calls dependent on each other js 
Javascript :: call back filter 
Javascript :: how to used xpath snapshot in loop 
Javascript :: javascript alert when site page opened not in chrome 
Javascript :: expected a string (for built-in components) or a class/function (for composite components) but got: undefined 
Javascript :: block scoped in js 
Javascript :: event listeners 
Javascript :: javascript case insensitive regex 
Javascript :: queryselector j 
Javascript :: how to use array of object in react 
Javascript :: grid in js 
Javascript :: Filtering an array for unique values 
Javascript :: Lazy Loading 
Javascript :: mongoose id validator 
Javascript :: download canvas to png 
Javascript :: javascript function syntax 
Javascript :: javascript css 
Javascript :: custom js shopify 
Javascript :: curl to javascript fetch 
Javascript :: regex for ipv4 
Javascript :: sum an array of objects 
Javascript :: use node js as backend with angular frontend 
Javascript :: ng class project 
Javascript :: math question 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =