HTML and CSS Reference
In-Depth Information
Figure 11.36 A selection list's properties before anything has been selected.
Figure 11.37 A selection list's properties after an item has been selected.
EXAMPLE 11.22
<html>
<head><title>Drop-Down Menus</title>
<script type="text/javascript">
1
function schedule(f) {
2
if( f.menu1.selectedIndex == 0 ){
// Could also say: document.form1.menu1.selectedIndex
3
f.text1.value="PL100, Feb 3-7, 9am to 5pm, Room 2133,
Dr. Baloney "
// Could also say: document.form1.text1.value
}
if(f.menu1.selectedIndex == 1){
f.text1.value="PL200 Feb 10-13 9am to 5pm, Room 209B,
Ms. Eclectic";
}
if(f.menu1.selectedIndex == 2){
f.text1.value="UX101 Mar 2-6 9am to 5pm, Room 209,
Mr. Nerdly";
}
Search WWH ::




Custom Search