Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript live time

var span = document.getElementById('span');

function time() {
  var d = new Date();
  var s = d.getSeconds();
  var m = d.getMinutes();
  var h = d.getHours();
  span.textContent = 
    ("0" + h)+ ":" + ("0" + m).substr(-2) + ":" + ("0" + s);
}

setInterval(time, 1000);
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript update attribute 
Javascript :: put form action jquery 
Javascript :: cypress clear session storage 
Javascript :: js remove the last character of a string 
Javascript :: regex remove non numeric 
Javascript :: react native android build apk 
Javascript :: create element ns svg 
Javascript :: each input form jquery 
Javascript :: convert a string to html element in js 
Javascript :: JSONStringify c# 
Javascript :: js create div 
Javascript :: sequelize exclude attribute 
Javascript :: jquery check if field exist by name 
Javascript :: js get viewport width 
Javascript :: regex get only domain name from url 
Javascript :: prevent form submit javascript 
Javascript :: show 5 entries in datatable 
Javascript :: google sheets get sheet by name 
Javascript :: is email js 
Javascript :: This version of CLI is only compatible with Angular versions ^9.0.0-beta || =9.0.0 <10.0.0, but Angular version 8.1.3 was found instead. 
Javascript :: javascript how to get a random element from an array 
Javascript :: js random string 
Javascript :: jquery click on parent but not child 
Javascript :: jquery checkbox set checked 
Javascript :: increase font size chartjs 
Javascript :: js change url 
Javascript :: how to set session storage in javascript 
Javascript :: Node.js: printing to console without a trailing newline 
Javascript :: javascript generate random string 
Javascript :: react native settimeout 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =