Assignment 29: A Possible Answer


<SCRIPT LANGUAGE="javascript">
function TellMe()
var number = document.DropDown.DDlinks.selectedIndex;
var answer = document.DropDown.DDlinks.options[number].value;

<FORM NAME="DropDown">
<OPTION SELECTED VALUE="Pick One Please">What Is The Code For?
<OPTION VALUE="<B>text</B>" > Bold
<OPTION VALUE="<I>text</I>"> Italic
<OPTION VALUE="<U>text</U>"> Underline
<INPUT TYPE="BUTTON" VALUE="Click To Find Out!" onClick="TellMe()">
<INPUT TYPE="text" SIZE="30" NAME="Result">


Gives you this:


     This is the same code that was used to create the box in Lesson 27, with a few modifications. I added one extra variable, "answer," that was assigned the number the user chose.

     Then I used that to force that menu item's value into the new text box I named "Result."


Did You Get It?


Back to the Index Page