name
This page has been flagged with the following issues:
High-level issues:
| Applies to | ? |
|---|
Examples
The following example shows how to set the NAME attribute on a dynamically created A element.
var oAnchor = document.createElement("<A NAME='AnchorName'></A>");
The following example shows how to set the NAME attribute on a dynamically created A element. This example assumes that ppvDocument is a valid IHTMLDocument2 interface pointer, and ppvElement is a valid IHTMLElement interface pointer.
ppvDocument->createElement(CComBSTR("<A NAME='AnchorName'></A>"), &ppvElement)
View live exampleThe following example shows how to set the NAME dynamically on objects (option buttons) created with the createElement method.
var inp = document.createElement('input');
inp.setAttribute('type', 'radio');
inp.setAttribute('name', 'Q'+count);
inp.setAttribute('value', answers[i]);
Notes
Remarks
When you submit a form, use the name property to bind the value of the control. The name is not the value that is displayed for the input type=button, input type=reset, and input type=submit input types. The internally stored value is submitted with the form, not the displayed value. When you submit a form, use the name property to bind the value of the control. The name is not the value displayed for the input type=button, input type=reset, and input type=submit input types. The internally stored value is submitted with the form, not the displayed value. Microsoft JScript allows you to change the name 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 that you use for submitting elements. Windows Internet Explorer 8 and later. In IE8 Standards mode, dynamically setting the name attribute on an input type=radio button correctly applies that button to the same named group. For more information about IE8 mode, see Defining Document Compatibility. In Internet Explorer 8 and later versions, you can set the NAME attribute at run time on elements that are dynamically created with the createElement method. To create an element with a NAME attribute in earlier versions of Windows Internet Explorer, include the attribute and its value when you use the createElement method. In Microsoft Internet Explorer 6 and later versions, this property applies to the attribute object.
Syntax
Standards information
- Document Object Model (DOM) Level 1 Specification, Section 2.5.5
- HTML 4.01 Specification, Section 17.3
See also
Related articles
html
… further results"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)
aappletattributebuttonembedformimginput type=buttoninput type=checkboxinput type=fileinput type=hiddeninput type=imageinput type=passwordinput type=radioinput type=resetinput type=submitinput type=textlinkmapobjectrtrubyselecttextArea
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