Applications Windows
Réduire la table des matières
Développer la table des matières
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

value attribute | value property

Sets or retrieves the value which is returned to the server when the form control is submitted.

HTML 4.01 Specification, Section 17.6.1



HTML<element value="p" ... >

p = object.value


Property values

Type: String

the value of a control object which is passed as a name/value pair to the server, when an object is submitted.

Standards information


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.


This example sets the value for each option element to a supply stock number.

<script type="text/javascript">
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;
<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>

See also




© 2016 Microsoft