Question: Write a JavaScript program which will display a button with text What time is it?. When user click the button, it will display the current

 Write a JavaScript program which will display a button with text

Write a JavaScript program which will display a button with text "What time is it?". When user click the button, it will display the current local time with the format hh:mm:ss.ms. where hh is two digit represent the current hour. 00 means midnight. If the value is less than 10 then add a 0 in front of the hour value. Similar to treat minutes and seconds. After the seconds, you will place a decimal (.) and then followed by one digit of milliseconds. The clock will update every 100 milliseconds. You can use setTimeout function (or other function) to do this. The diagrams show some of the screen shot after user clicked the button. What time is it? What time is it? 23:52:00.523:53:04.7 What time is it? What time is it? 00:03:01.1 00:03:52.1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!