dcsimg

Lesson 27: The Script and Its Effect



The Script

<SCRIPT LANGUAGE="javascript">
function LinkUp()
{
var number = document.DropDown.DDlinks.selectedIndex;
location.href = document.DropDown.DDlinks.options[number].value;
}
</SCRIPT>

<FORM NAME="DropDown">
<SELECT NAME="DDlinks">
<OPTION SELECTED>Choose a Link
<OPTION VALUE="page.html"> Page One
<OPTION VALUE="page2.html"> Page Two
<OPTION VALUE="page3.html"> Page Three
</SELECT>

<INPUT TYPE="BUTTON" VALUE="Click to Go!" onClick="LinkUp()">
</FORM>

 

The Script's Effect

 

Back to the Index Page