Show or print the current time using javascript in your web Page.
Jun 19, 2021
— create an element with id or class in your html as i have added one <p> tag with id ‘demo’.
— Set an interval method to call a function at given interval
— Create an function.
— Select the date by the new Date() method.
— Convert the date into local time string.
— Select the element by the id or class and add the innerhtml for the time variable
— to select the element use document.getElementByClassName(‘ class name’) .