HTML and CSS Reference
In-Depth Information
Table 11.16 Methods of the select Object
Method
What It Does
blur()
Removes focus from the select box.
focus()
Puts focus in the select box.
handleEvent()
Invokes the handler for a specified event (JavaScript 1.2).
unwatch()
Turns off the watch for a particular property.
watch()
Watches, and when a property is changed, calls a function.
window
document
form
select
option
Figure 11.35 How the select object is created within the JavaScript hierarchy.
EXAMPLE 11.21
<html>
<head><title>Drop-Down Menus</title></head>
<body bgcolor="lightgreen">
<font face="arial">
<strong>Select a Course
1
<form name="form1">
2
<select name="menu1" size="4" >
3
<option name="choice1" value="Perl1">Intro to
Perl</option>
<option name="choice2" value="Perl2">Advanced
Perl</option>
 
Search WWH ::




Custom Search