/

HTML / CSS / JavaScript Tutorial

JavaScript Document own method: getElementsByName()

[this page | pdf | back links]

The getElementsByName() method (when applied to the document object of the JavaScript DOM) returns a NodeList containing all the elements with the specified name attribute.

 

It has the following syntax with the following parameters. It returns a NodeList representing a collection of all relevant elements, ordered as they appear in the source code.

 

document.getElementsByName(name)

 

Parameter

Required / Optional

Description

name

Required

String specifying the name attribute value of the elements you want to obtain

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile