Question
Wondering if someone can tell me what I'm doing wrong. I'm declaring variables and following the directions, but I keep getting an error that says
Wondering if someone can tell me what I'm doing wrong. I'm declaring variables and following the directions, but I keep getting an error that says I "didn't set the 'timeStamp' to the value 'February 3, 2018 3:15:28 AM'.
Here are the directions:
Variable Declaration
Declare a variable named thisTime containing a Dateobject for February 3, 2018 at 3:15:28 AM.
Use the toLocaleString() method to save the text of the thisTime variable in the timeStr variable.
Change the inner HTML code of the page element with the ID timestamp to the value of the timeStr variable.
Here's my code:
/*
New Perspectives on HTML5 and CSS3, 7th Edition Tutorial 9 Case Problem 1
Planisphere Script Author: XXX Date: XXX
*/ var thisTime = new Date("February 3, 2018 3:15:28 AM"); var timeStr = thisTime.toLocaleString(); document.getElementById("timestamp").innerHTML = timeStr;
Wondering if I'm doing something wrong.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started