EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

namedItem method

Retrieves a select object or an object from an options collection.

Syntax

object.namedItem(name, pdisp)

Parameters

name [in]

Type: String

A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.

Return value

Type: Object

Returns an object or a collection of objects if successful, or null otherwise.

Standards information

There are no standards that apply here.

Remarks

This method first searches for an object with a matching id attribute. If a match is not found, then the method searches for an object with a matching name attribute, but only on those elements that are allowed a name attribute.

Examples

The following example shows how to use the namedItem method to retrieve a div and change its innerHTML property.


<div id="oDIV1">This text will not change.</div>
<div id="oDIV2">This text will change.</div>
<button onclick="document.all.namedItem('oDIV2').innerHTML='Changed!';">
   Change Option
</button>

See also

options
select

 

 

Anzeigen:
© 2014 Microsoft