How do you make your msn display pic larger?

How to make a drop down menu using select option and display an alert and pic change?

  • Hi, i have this homework assignment for my class. And our teacher wants the page to load and display and pic, and she wants to have a drop down menu near the pic and when an option is selected for the pic to change and then an alert to come up, and i cant' get it right, can anyone help please? Assignment Complete the following exercise, to get familiar with making decisions and changing page content based on the decision. You will be using a switch: Download the 5 sunGuy images from DOC SHARING Create a web page named SwitchSunGuy.html Design the page so that it displays an image as well as a drop down list. When the page initially loads, display the questionSun.jpg image. When a selection is made from the drop down list (i.e .when its ‘changed’ – big hint), execute a function. The function will decide which item was selected in the drop down list and will change the image to that respective image and display a pop-up ‘alert’ message. The drop down box should have 5 options: Select (which will display the image questionSun.jpg and the greeting "Please make a selection or go back to bed!") Happy (which will display the image happySun.jpg and the greeting "I am glad you are happy") Sad (which will display the image sadSun.jpg and the greeting "I am sorry you are sad") Cool (which will display the image coolSun.jpg and the greeting "It's great you are feeling cool") Unsure (which will display the image unsureSun.jpg and the greeting "I hope you get past that soon!") Outside your function Declare a global variable to store the selection made from the selection box In your function: Use a Switch construct to evaluate the selection made. When a match is found, display the appropriate image and alert box. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-… <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> function update () { alert("Please go back to bed"); document.getElementById("sunimg").src = "questionSun.jpg"; } </script> </head> <body> <div id="selectoptions" align="center"> <select> <option>Please Select</option> <option onchange="update();">Select</option> <option>Happy</option> <option>Sad</option> <option>Cool</option> <option>Unsure</option> </select> </div> </br> <div id="sunimg" align="center"><img src="pics/questionSun.jpg" width="170" height="170" alt="question sun" /></div> </body> </html>

  • Answer:

    Declare the variable before you start testing.

Omid at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.