attributes
Summary
Associatve array containing the attributes of 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
Mozilla Developer Network : [Node.attributes Article]
Microsoft Developer Network: [attributes Collection Article]