Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM getElementsByName() method

HTML DOM getElementsByName() method

Document Object Reference Document Object


Definition and Usage

The getElementsByName() method returns a collection of objects with the specified name.

Syntax

document.getElementsByName(

name

)

Parameters Description
name Required. The name of the element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the getElementsByName() method.


Example

Example

Pop up the number of elements with the specified name:

Try it »


Document Object Reference Document Object