[Javascript] JavaScript Default Value

Peter Brunone peter at brunone.com
Wed Apr 21 11:01:32 CDT 2004


Hi Mark,

	To select any item in the list, use the read/write property
called selectedIndex; this indicates the position, in a zero-based
array, of the currently selected item (so setting selectedIndex to 0
would select the first item).

To reset (or "unselect") the list, set Windowsdropdown.selectedIndex =
-1.

Cheers,

Peter

-----Original Message-----
From: javascript-bounces at LaTech.edu  On Behalf Of mark

Hi,
Anyone know a solution to this problem. Have drop-down menu like this:
<select size="0" name="Windowsdropdown"
onChange="javascript:showdivsdropdown(this.form,'windowsOperatingSystem'
)"><
option value="select"  selected>select</option><option value="1" >1
</option><option value="2">2</option><option value="3">3</option><option
value="4">4</option></select>

I'm using divs in html and trying in javascript to get index into select
drop-down box to set the default value again. As can be seen be the
above example the default is selected. Is it possible in javascript to
reset this default value?





More information about the Javascript mailing list