faqts : Computers : Programming : Languages : JavaScript : Forms : SELECT

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

185 of 224 people (83%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

How do I find the value of a SELECT element?

Apr 17th, 2000 16:04
Martin Honnen,


NN6 and IE4+ provide a
  value
property for SELECT elements thus
  document.formName.selectName.value
is sufficient with these browsers. For other browsers and cross browser 
code use
  var select = document.formName.selectName;
  var value = select.options[select.selectedIndex].value