Create a switch/case statement that tests values of the wDay variable from 0 to 6. If wDay equals 0, set imgSrc to the text string sunday.png; if wDay equals 1, setimgSrc to monday.png; and so forth. Store the text string in the htmlCode variable where imgsrc is the value of the imgSrc variable. Store the value of the imgSrc variable in the inner HTML of the element with the ID banner. here is my code , i am having trouble with understanding how to do the switch statement: var thisDay = new Date ("October 18, 2020"); var wDay = thisDay.getDay(); var imgSrc = ''; switch(wDay) { case wDay = 0: ; break; case wDay = 1: ; break; case wDay = 2: ; break; case wDay = 3: ; break; case wDay = 4: ; break; case wDay = 5: ; break; case wDay = 6: ; } document.getElementById("imgSrc").innerHTML = "banner";
Create a switch/case statement that tests values of the wDay variable from 0 to 6. If wDay equals 0, set imgSrc to the text string sunday.png; if wDay equals 1, setimgSrc to monday.png; and so forth. Store the text string in the htmlCode variable where imgsrc is the value of the imgSrc variable. Store the value of the imgSrc variable in the inner HTML of the element with the ID banner. here is my code , i am having trouble with understanding how to do the switch statement: var thisDay = new Date ("October 18, 2020"); var wDay = thisDay.getDay(); var imgSrc = ''; switch(wDay) { case wDay = 0: ; break; case wDay = 1: ; break; case wDay = 2: ; break; case wDay = 3: ; break; case wDay = 4: ; break; case wDay = 5: ; break; case wDay = 6: ; } document.getElementById("imgSrc").innerHTML = "banner";
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
im doing this practice assignment and it wants me to:
Create a switch/case statement that tests values of the wDay variable from 0 to 6. If wDay equals 0, set imgSrc to the text string sunday.png; if wDay equals 1, setimgSrc to monday.png; and so forth.
Store the text string <img src='imgsrc' alt='' />in the htmlCode variable where imgsrc is the value of the imgSrc variable.
Store the value of the imgSrc variable in the inner HTML of the element with the ID banner.
here is my code , i am having trouble with understanding how to do the switch statement:
var thisDay = new Date ("October 18, 2020");
var wDay = thisDay.getDay();
var imgSrc = '';
switch(wDay) {
case wDay = 0:
<img src = 'sunday.png' alt=''/>;
break;
case wDay = 1:
<img src = 'monday.png' alt = ''/>;
break;
case wDay = 2:
<img src = 'tuesday.png' alt=''/>;
break;
case wDay = 3:
<img src = 'wednesday.png' alt=''/>;
break;
case wDay = 4:
<img src = 'thursday.png' alt=''/>;
break;
case wDay = 5:
<img src = 'friday.png' alt=''/>;
break;
case wDay = 6:
<img src = 'saturday.png' alt=''/>;
}
document.getElementById("imgSrc").innerHTML = "banner";
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY