Page 1 of 1

Consider the following page that could be used by an indecisive person to choose what's for dinner. You may assume that

Posted: Sat May 14, 2022 6:34 pm
by answerhappygod
Consider The Following Page That Could Be Used By An Indecisive Person To Choose What S For Dinner You May Assume That 1
Consider The Following Page That Could Be Used By An Indecisive Person To Choose What S For Dinner You May Assume That 1 (97.52 KiB) Viewed 33 times
Consider the following page that could be used by an indecisive person to choose what's for dinner. You may assume that the following images are stored in the same folder as this page: mystery.gif (a question mark), pizza.jpg (a pizza), burgers.jpg (a burger), and sushi.jpg (a sushi roll). <! doctype html> <html> <head> <title>Dinner Page</title> <script type "text/javascript" src="http://balance 3e.com/random-js"></script> </head> <body> <img id="dinnerImg" src="mystery.gif" alt="food picture"> <p> <input type="button" value="Choose Your Dinner" onclick="dinner - Randomoneof(['pizza', 'burgers', 'sushi']); document.getElementById('dinnerImg').src = dinner + '.jpg';"> </p> <hr> <div id="output Div">Click the button for a dinner recommendation.</div> </body> Q </html> 1. Draw a picture of the Web page that would be displayed when this HTML document is loaded. Your drawing should clearly show the layout of the page elements, along with any text, labels, and default values, as they would initially appear in the page. 2. What is the purpose of the SCRIPT tags in the HEAD of the page? Would the page look same if these tags were omitted? Would it behave the same if these tags were omitted? Explain. 3. What behavior would be exhibited within the page when the user clicks on the button? Be specific. [Recall: the RandomOneOf function returns a randomly selected item from its input list.] 4. Augment the above page so that, in addition to its current behavior, a message also appears in the output Div page division when the user clicks on the button. The message should be of the form "I recommend XXX for dinner." where XXX is the dinner choice corresponding to the selected image (e.g., sushi). You can list the new text below, and then mention where that text would be inserted into the page.