Share via


getElementsByName method

Gets a collection of objects based on the value of the IHTMLDOMAttribute2::name or IHTMLElement::id attribute.

Syntax

IHTMLElementCollection retVal = object.getElementsByName(v);

Parameters

Standards information

Remarks

When you use the IHTMLDocument3::getElementsByName method, all elements in the document that have the specified IHTMLDOMAttribute2::name attribute or IHTMLElement::id attribute value are returned.

Elements that support both the IHTMLDOMAttribute2::name attribute and the IHTMLElement::id attribute are included in the collection returned by the IHTMLDocument3::getElementsByName method, but elements with a IHTMLDOMAttribute2::name IHTMLDocument2::expando are not included in the collection; therefore, this method cannot be used to retrieve custom tags by name.

See also

About the W3C Document Object Model