Sets or retrieves the value which is returned to the server when the form control is submitted.
dhtml语法
html | <ELEMENT VALUE
= sValue... >
|
---|
Scripting | object.value [ = sValue ] |
---|
DHTML可能的值
sValue | String that
specifies or receives the value of a control object which is passed as a name/value pair to the server, when an object is submitted. |
The property is read/write.
The property has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see about dynamic properties.
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.
DHTML代码范例
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>
是否符合公共标准
This property is defined in
HTML 3.2 and
is defined in
World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 .
Applies To
更多语法参考
input