Question: Im lost on this problem. My code is a mess. Please help. Event List Scroll down the document and directly after the closing tag insert
Im lost on this problem. My code is a mess. Please help.
Event List
Scroll down the document and directly after the closing tag insert a div element with the ID eventList. It is within this element that you will write the HTML code for the table of upcoming theater events.
Variables
Go to the lht_table.js file and below the comment section, declare a variable named thisDay containing the date August 30, 2018. You will use this date to test your script.
Create a variable named tableHTML that will contain the HTML code of the events table. Add the text of the following HTML code to the initial value of the variable:
Upcoming Events
Date
Event
Price
Lewis only wants the page to list events occurring within 14 days after the current date. Declare a variable named endDate that contains a Date object that is 14 days after the date stored in the thisDay variable.
(Hint : Use the new Date() object constructor and insert a time value that is equal to thisDay.getTime() + 14 x 24 x 60 x 60 x 1000.)
For Loop
Create a for loop that loops through the length of the eventDates array. Use i as the counter variable.
Within the for loop insert the following commands in a command block:
Declare a variable named eventDatecontaining a Date object with the date stored in the i entry in the eventDatesarray.
Declare a variable named eventDay that stores the text of the eventDate date using the toDateString() method.
Declare a variable named eventTimethat stores the text of the eventDatetime using the toLocaleTimeString()method.
Insert an if statement that has a conditional expression that tests whether thisDay is eventDate and eventDateendDate. If so, the event falls within the two-week window that Lewis has requested and the script should add the following HTML code text to the value of the tableHTML variable.
eventDay @ eventTime
description
price
Where eventDay is the value of the eventDay variable, eventTime is the value of the eventTime variable, description is the i entry in the eventDescriptions array, and price is the i entry in the eventPrices array.
HTML Table Code
After the for loop, add the text of the HTML code
to the value of the tableHTML variable.
Insert the value of the tableHTML variable into the inner HTML of the page element with the ID eventList.
Upcoming Events at the Lyman Hall Theater
eventList>
>>>>>>>>>>lht_table.js<<<<<<<<<<<<<<<<<
"use strict";
/*
New Perspectives on HTML5 and CSS3, 10.4
*/
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
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!