This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

attributes

Summary

Associatve array containing the attributes of node.

Property of dom/Nodedom/Node

Syntax

Note: This property is read-only.

var result = element.attributes;

Return Value

Returns an object of type

NamedNodeMap that allows to access attributes through their names.

Usage

 Retrieve a listing of ALL Nodes of an element, including developer defined attributes and data- prefixed attributes.

The depreciated presentational attributes are datafld, datasrc, marginwidth, marginheight, allowtransparency, vspace, hspace, height, width, align, valign, alink, link, vlink, background, bgcolor, color, fgcolor, border, cellpadding, cellspacing, clear, frameborder, nowrap, scrolling

Notes

For backwards compatibility first test if an attribute Node is null. Binary attributes may or may not have a value

Related specifications

Document Object Model (DOM) Level 3 Core Specification
W3C Recommendation

Attributions