Javascript Knowledge

  • what is javascript

  • javascript Variable
  • javascript function
  • javascript Event

  • JavaScript If
  • javascript for

  • javascript object
  • Javascript String
  • Javascript Date
  • Javacsript Array
  • Javascript Math

  • Javascript onclick
  • JavaScript onload

  • Javascript Frame
  • Javascript Image
  • Javascript Style
  • Javascript Textarea
  • Javascript Table
  • Javascript window
  • Javascript Location
  • Javacsript form
  • Javascript Checkbox
  • Javascript Input
  • Javascript Radio
  • Javascript Select
  • Javascript Submit

  • Javascript alert
  • Javascript close
  • Javascript confirm
  • Javascript Document open
  • Javascript getElementById
  • Javascript print
  • Javascript reload
  • Javascript remove
  • JavaScript replace
  • Javascript setTimeout
  • JavaScript split
  • JavaScript substring
  • Javascript window open
  • window showmodaldialog

  • Javascript href
  • Javascript IFrame
  • Javascript innerHTML
  • Javascript selectedindex
  • Javascript URL
  • Javascript window Location

  • javascript write to file
  • JavaScript write
  • javascript string to integer
  • Javascript popup
  • Javascript return
  • Javascript Obfuscator
  • Javascript disable
  • Javascript Hide
  • More others

    Javascript
    CSS
    PHP

     

    Javascript select


    Javascript Select Object

    The Javascript Select object represents a drop-down list in an HTML form. For each instance of an HTML <select> tag in a form, a Select object is created.

    You can access a Javascript Select object by indexing the elements array (by number or name) of the corresponding form or by using getElementById().

    IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).

    Javascript Select Object Collections

    Collection

    Description

    IE 

    F

    N

    W3C

    options[]

    Returns an array of all the options in a dropdown list

    3

    1

    2

    Yes

    Javascript Select Object Properties

    Property

    Description

    IE 

    F

    N

    W3C

    accessKey

    Sets or returns the keyboard key to access the dropdown list

    4

     

     

    No

    align

    Sets or returns the alignment of the dropdown list according to the surrounding text

    4

     

     

    No

    disabled

    Sets or returns whether or not the dropdown list should be disabled

    5

    1

    6

    Yes

    form

    Returns a reference to the dropdown list's parent form

    3

    1

    2

    Yes

    id

    Sets or returns the id of the dropdown list (In IE 4 this property is read-only)

    4

    1

     

    No

    length

    Sets or returns the number of options in the dropdown list

    3

    1

    2

    Yes

    multiple

    Sets or returns a Boolean value that indicates whether or not multiple items can be selected

    3

    1

    6

    Yes

    name

    Sets or returns the name of the dropdown list

    3

    1

    2

    Yes

    selectedIndex

    Sets or returns the index of the selected option in the dropdown list

    3

    1

    2

    Yes

    size

    Sets or returns the number of rows in the dropdown list

    3

    1

    6

    Yes

    tabIndex

    Sets or returns the tab order for the dropdown list

    5

     

     

    Yes

    type

    Returns the type of the form element. For a dropdown list it will be "select-one" or "select-multiple"

    4

    1

    3

    Yes

    value

    Sets or returns the value to be returned to the server when the form is submitted

    3

    1

    6

    Yes

    Javascript Select Object Methods

    Method

    Description

    IE

    F

    N

    W3C

    add()

    Adds an option to the dropdown list

    4

     

     

    Yes

    blur()

    Removes focus from the dropdown list

    4

    1

    3

    Yes

    focus()

    Sets focus on the dropdown list

    4

    1

    3

    Yes

    remove()

    Removes an option from the dropdown list

    4

    1

    6

    Yes

    Javascript Select Object Events

    Syntax: object.event_name="someJavaScriptCode"

    Event

    Description

    IE

    F

    N

    W3C

    onBlur

    Executes some code when the dropdown list loses focus

    3

    1

    2

     

    onChange

    Executes some code when the dropdown list loses focus and its value has altered

    3

    1

    2

     

    onClick

    Executes some code when the user clicks the left mouse button in the dropdown list

    4

     

     

     

    onFocus

    Executes some code when the dropdown list gets focus

    4

    1

    2

     

     

     





















     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Javascript |