Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2. Go to the lht_events.html file in your editor. Directly above the closing head > tag, insert script elements that link the page to the
2. Go to the lht_events.html file in your editor. Directly above the closing head > tag, insert script elements that link the page to the Iht_list.js and Iht_table.js files in that order. Defer the loading and running of both script files until after the page has loaded. 3. 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. Close the file saving your changes. (Hint: Be sure to review this file and all the support files, noting especially the names of variables that you will be using in the code you create.) 4. Go to the lht_table.js file in your editor. Below the comment section, declare a variable named thisDay containing the date October 1, 2021. You will use this date to test your script. 5. 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 DateEventPrice 6. 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 () +142460601000.) 7. Create a for loop that loops through the length of the eventDates array. Use i as the counter variable. 8. Within the for loop insert the following commands in a command block: a. Declare a variable named eventDate containing a Date object with the date stored in the ith entry in the eventDates array. b. Declare a variable named eventDay that stores the text of the eventDate date using the toDatestring () method. c. Declare a variable named eventTime that stores the text of the eventDate time using the toLocaletimestring() method. d. Insert an if statement that has a conditional expression that tests whether thisDay is eventDate and eventDate endDate. 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 eventDay Q eventTime description price where eventDay is the value of the eventDay variable, eventTime is the value of the eventTime variable, description is the ith entry in the eventDescriptions array, and price is the ith entry in the eventPrices array. 9. After the for loop, add the text of the HTML code table > to the value of the tableHTML. variable. 10. Insert the value of the tableHTML variable into the inner HTML of the page element with the ID eventList. 11. Document your code in the script file using appropriate comments. 12. Save your changes to the file, and then load the Iht_events.html file in your browser. Verify that the page shows theater events over a two-week period starting with Friday, October 1, 2021 and concluding with Thursday, October 14, 2021.Not the question youre looking for?Post any question and get expert help quickly.Start learning Chegg Products & ServicesChegg Study HelpCitation GeneratorDigital Access CodesGrammar CheckerMath SolverMobile AppsSolutions ManualPlagiarism CheckerChegg PerksCompanyCompanyAbout CheggChegg For GoodCollege MarketingInvestor RelationsJobsJoin Our Affiliate ProgramMedia CenterSite MapChegg NetworkChegg NetworkBusuuCitation MachineEasyBibMathwayThinkfulCustomer ServiceCustomer ServiceGive Us FeedbackCustomer ServiceManage SubscriptionEducatorsEducatorsAcademic IntegrityHonor ShieldInstitute of Digital Learning 2003-2024 Chegg Inc. All rights reserved.Cookie NoticeYour Privacy ChoicesDo Not Sell My InfoGeneral PoliciesPrivacy Policy (New)Honor CodeIP Rights
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