How should the code be written to include the \"h2 date h2\" element in the date
ID: 3713461 • Letter: H
Question
How should the code be written to include the "h2 date h2" element in the dateHTML instructions, the third instruction under the "Variable Declaration" header. I cannot decifer the error code at the right of the screenshot.
(Saturday). + Back 13 the Bridger College student union. Variable Declaration 15 */ Test Results Declare the thisDate variable containing the Date object for the date October 12, 2018. /root/sandbox bc_fbicon.png bc_logo.png bc_quiz.png 2bc_reset.css bc_styles.css abc_today.js Ebc_twittericon.png 2bc_union.html 3/4 passed Code Pattern Declare the dateString variable containing the text of the thisDate variable using local conventions. 17 var thisDate = new Date("October 12, 2018"); 18 var dateString = thisDate.toLocaleDateString(); 19 var dateHTML= dateString.valueof(); 20 var thisDay = thisDate.getDay(); X FAILED: Declared dateHTML variable 22 var eventHTML = .getEvent(thisDay); Declare the dateHTML variable containing the following text string date where date is the value of the dateString variable. DESCRIPTION Searched your code for a specific pattern: 24 document.insertAdjacentHTML("unionToday nnerHTML = dateHTML + eventHTML; 25 dateHTMLs*=.+h2 You can learn more about regular expressions here. Create the thisDay variable containing the day of the week number from the thisDate variable. (Hint: Use the getDay() method.) 26 function getEvent (day) { var eventHTML; switch (day) { case 0: // Sunday Events eventHTML = " Highlights from the Bridge Art Collection ? PASSED: Declared dateString variableExplanation / Answer
declare the variable dateHTML like below:
var dateHTML = "<h2>" + dateString + "</h2>";
this will solve the problem.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.