On Tue, 24 Jan 2017, Karl Dahlke wrote:
Honestly I don't know if it's suppose to be an array or an object. Not sure of
the spec.
If an array, does the order of attributes matter?
I don't think the order matters. I think the indices are strings and so
you would reference them like a hash table of name-value pairs that aren't
in order.
I found this in the MDN pages,
The Element.attributes property returns a live collection of all attribute
nodes registered to the specified node. It is a NamedNodeMap, not an
Array, so it has no Array methods and the Attr nodes' indexes may differ
among browsers. To be more specific, attributes is a key/value pair of
strings that represents any information regarding that attribute.
And for NamedNodeMap it says,
The NamedNodeMap interface represents a collection of Attr objects.
Objects inside a NamedNodeMap are not in any particular order, unlike
NodeList, although they may be accessed by an index as in an array.
https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes
https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev