EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.
이 항목은 아직 평가되지 않았습니다.- 이 항목 평가

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.

pdisp [out, retval]
C++The address of a pointer to a variable that receives an IDispatch interface for the object or collection if successful, or null otherwise.
JavaScriptReturns an object or a collection of objects if successful, or null otherwise.

Return value

Type: Object

The address of a pointer to a variable that receives an IDispatch interface for the object or collection if successful, or null otherwise.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.

The namedItem method was introduced in Microsoft Internet Explorer 6

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

 

 

Send comments about this topic to Microsoft

Build date: 11/28/2012

커뮤니티 추가 항목

추가
© 2013 Microsoft. All rights reserved.