Re: Native DOM way to get nodes of arbitrary type/name

05.10.2013, 14:12, "Bjoern Hoehrmann" <derhoermi@gmx.net>:
> * Marat Tanalin wrote:
>
>> It would be nice to have a native (usable and performant) DOM way for
>> retrieving DOM nodes by node type (or, alternatively, by node name).
>>
>> This could be represented by these two simple methods:
>>
>> šššš* element.getNodesByType(type) -- to get _all_ nodes
>> ššššššof specified type contained in the element
>> šššššš(like `element.getElementsByTagName('*')` for elements);
>
> Use XPath

Thank you for your attention, Bjoern.

My message is not about searching for an instantaneous existing solution (nor the mailing list is a forum for questions of such type).

My message is a proposal intended to improve the DOM standard in general and to make it more universal and consistent.

XPath is not DOM or a part of it.
XPath is not as intuitive/easy-to-use as DOM.
XPath involves parsing "selector" always.

Of course, XPath could still be utilized for polyfilling the proposed DOM features in older XPath-capable browsers.

Received on Saturday, 5 October 2013 12:11:47 UTC