Skip to Main Content
JavaScript: The Definitive Guide, Fourth Edition
book

JavaScript: The Definitive Guide, Fourth Edition

by David Flanagan
November 2001
Intermediate to advanced content levelIntermediate to advanced
936 pages
68h 43m
English
O'Reilly Media, Inc.
Content preview from JavaScript: The Definitive Guide, Fourth Edition

Name

NamedNodeMap — a collection of nodes indexed by name or position

Availability

DOM Level 1 Core

Properties

readonly unsigned long length

The number of nodes in the array.

Methods

getNamedItem( )

Looks up a named node.

getNamedItemNS( ) [DOM Level 2]

Looks up a node specified by namespace and name.

item( )

Obtains the node at a specified position within the NamedNodeMap. In JavaScript, you can also do this by using the node position as an array index.

removeNamedItem( )

Deletes a named node from the NamedNodeMap.

removeNamedItemNS( ) [DOM Level 2]

Deletes a node specified by name and namespace from the NamedNodeMap.

setNamedItem( )

Adds a new node to (or replaces an existing node in) the NamedNodeMap. The nodeName property of the Node object is used as the name of the node.

setNamedItemNS( ) [DOM Level 2]

Adds a new node to (or replaces an existing node in) the NamedNodeMap. The namespaceURI and localName properties of the Node object are used as the node name.

Description

The NamedNodeMap interface defines a collection of nodes that may be looked up by their nodeName property or, for nodes that use namespaces, by their namespaceURI or localName properties.

The most notable use of the NamedNodeMap interface is the attributes property of the Node interface: a collection of Attr nodes that may be looked up by attribute name. Many of the methods of NamedNodeMap are similar to the methods of Element for manipulating attributes. Element attributes are usually most easily manipulated ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

JavaScript: A Beginner's Guide, Fourth Edition, 4th Edition

John Pollock
Coding with JavaScript For Dummies

Coding with JavaScript For Dummies

Chris Minnick, Eva Holland

Publisher Resources

ISBN: 0596000480Supplemental ContentCatalog PageErrata