Sets or retrieves the name of the control, bookmark, or application.
Syntax
HTML <ELEMENT NAME = sName ... > Scripting object.name [ = sName ]
Possible Values
sName String that specifies the name. The property is read/write with no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.
Remarks
When submitting a FORM, use the name property to bind the value of the control. The name is not the value displayed for the button, reset, and submit input types. The internally stored value, not the displayed value, is the one submitted with the form.
Microsoft® JScript® (compatible with ECMA 262 language specification) allows the name to be changed at run time. This does not cause the name in the programming model to change in the collection of elements, but it does change the name used for submitting elements.
In Internet Explorer 5, the name property cannot be set at run time on anchor objects dynamically created with the createElement method. To create an anchor with a NAME attribute, include the attribute and value when using the createElement method, or use the innerHTML property.
Example
This example sets the NAME attribute on a dynamically created anchor.var oAnchor = document.createElement("<A NAME='AnchorName'></A>");
Applies To