Select : Select « Form « JavaScript Tutorial

JavaScript Tutorial
1. Language Basics
2. Operators
3. Statement
4. Development
5. Number Data Type
6. String
7. Function
8. Global
9. Math
10. Form
11. Array
12. Date
13. Dialogs
14. Document
15. Event
16. Location
17. Navigator
18. Screen
19. Window
20. History
21. HTML Tags
22. Style
23. DOM Node
24. Drag Drop
25. Object Oriented
26. Regular Expressions
27. XML
28. GUI Components
29. Dojo toolkit
30. jQuery
31. Animation
32. MS JScript
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript Tutorial » Form » Select 
10. 12. 1. Select

Instances are created by the browser when it encounters an HTML

In the JavaScript object hierarchy, the Select object is located at window.document.Form.Select.

Event Handlers, Methods, and Properties Used by the Select Object

Event Handlers/Methods/PropertiesDescription
onBlurExecuted when the select box loses the focus.
onChangeExecuted when the select box loses the focus and has had its value modified.
onFocusExecuted when the select box receives the focus.
blur()Removes the focus from the select box.
focus()Gives the focus to the select box.
handleEvent()Invokes the handler for the event specified and was added in JavaScript 1.2.
formReturns the entire form the select box is in.
lengthReturns the number of options in the select box.
nameReturns the name of this select box specified by the NAME attribute.
optionsReturns an array containing each of the items in the select box. These items are created using the
selectedIndexReturns an integer specifying the indexed location of the selected option in the select box.
typeReturns the type specified by the TYPE attribute. For


<html>
    <head>
    <script language="JavaScript">
    <!--
    function openWin(){
      var myInstance = document.myForm.mySelect;
      var myWin = open("""","width=450,height=200");

      myWin.document.write("The length is: " + myInstance.length + "<br>");
      myWin.document.write("The name is: " + myInstance.name + "<br>");
      myWin.document.write("The selected option is located at position: ");
      myWin.document.write(myInstance.selectedIndex + "<br>");
      myWin.document.write("The type is: " + myInstance.type + "<br>");

      myWin.document.write(myInstance.form.myButton.value);
      myWin.document.close();
    }
    -->
    </script>
    </head>
    <body>
    <form name="myForm">My Favorite Sport is:
      <select name="mySelect">
        <option value=A>AA</option>
        <option value=B>BB</option>
        <option value=C>CC</option>
        <option value=D>DD</option>
      </select>
    <input type=BUTTON value="Click to Process" name="myButton"
             onClick="openWin()">
    </form>
    </body>
    </html>
10. 12. Select
10. 12. 1. Select
10. 12. 2. Select.blur()
10. 12. 3. Select.focus()
10. 12. 4. Select.form
10. 12. 5. Select.handleEvent()
10. 12. 6. Select.length
10. 12. 7. Select.name
10. 12. 8. Select.onBlur
10. 12. 9. Select.onChange
10. 12. 10. Select.onFocus
10. 12. 11. Select.options
10. 12. 12. Select.options.length
10. 12. 13. Select.options.selectedIndex
10. 12. 14. Select.options.value
10. 12. 15. Select.selectedIndex
10. 12. 16. Select.type
10. 12. 17. Triggering a Value Change from a Pop-Up Menu
10. 12. 18. Grouped selection control on change event
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.