value (select, option element)
This page has been flagged with the following issues:
High-level issues:
| Applies to | ? |
|---|
Examples
This example sets the value for each option element to a supply stock number.
<SCRIPT>
<script>
function fnShowText(){
/* Use the selectedIndex property of the SELECT control
to retrieve the text from the options collection. */
var sText = "Stock Number = " + oSel.options(oSel.selectedIndex).value;
alert(sText);
}
</script>
<SELECT ID="oSel" onchange = "fnShowText()">
<OPTION VALUE="STK#45">Item One - Basketball</OPTION>
<OPTION VALUE="STK#347">Item Two - Baseball</OPTION>
<OPTION VALUE="STK#67">Item Three - Hockey Puck</OPTION>
</SELECT>
</SCRIPT>
Notes
Remarks
Individual control objects return a value to the server only if they have been selected by the user. You may pass server-friendly data directly to the server without confusing the user. The user sees only the innerText displayed, and not the value.
Syntax
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 2.5.5
- HTML 4.01 Specification, Section 17.6.1
See also
Related articles
html
warning.png"html" is not in the list of possible values (Canvas, CSS Font, CSS Layout, Animation, Audio, Background, Border, Box Model, CSS Attributes, CSSOM, Combinators, Deprecated, Document Structure, Exclusions, FileSystemAPI, Filters, Flexbox, Fonts, Generated and Replaced Content, Gradients, Grid Layout, HTML, Multimedia, Media Queries, Mobile, Multi-Column, Off-line Storage, Paged Media, Performance, Pointer Events, Pseudo-Classes, Pseudo-Elements, Regions, Responsive Web Design, Ruby, Scrollbar, Selectors, Security, Syntax, Tables, Text, Touch, Transforms, Transitions, Video, Visual Effects, Web Components, WebRTC, XHR) for this property.
Related pages (MSDN)
optionselect
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here