Web hosting provider - 396 . Chapter 20 The setDefault() function
Monday, December 31st, 2007396 . Chapter 20 The setDefault() function works with any type of select object, whether it is a multiple one or not. It simply loops through the options of the select object and sets the selected property of each to its defaultSelected property, reverting all options to their default selection state. The value handed to the function is the select object, referenced as this.form.myMenu. Note: Microsoft Internet Explorer does not fully support the select object. The entire discussion is based on Navigator because it simply does not work for Microsoft s browser. As you can see, Microsoft has focused on the user interface of its browser but did not pay much attention to script-level access via JavaScript. The average web surfer does not feel the disadvantages because web content providers use only features that are supported by both browsers. text There is no HTML attribute that defines the option s label. Take a look at Example 20-11. The strings First option, Second option, and so forth are not specified in any HTML attribute as you could expect. They are simply appended to the