W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2002

method to return only the specificied child elements?

From: Paul Ekeland <pekeland@credm.com>
Date: Mon, 21 Jan 2002 10:48:55 +0100
To: <www-dom@w3.org>
Hello everyone,

I have discovered DOM fairly recently and I am trying to understand all the
subtilities of it. Forgive me if this question has already been answered in
the mailing list, but the search feature is not working currently on the
archives of the list.

Here is the question: how come there are no method that allows an Element to
get only the child elements specified by their tag name? The
getElementsByTagName() method returns all the descendant elements with that
tag name, so why is there not one that returns only the children with that
tag name? There are ways of course to bypass this (by checking the parent
node of the resulting list provided by getElementsByTagName() for
example,...), but I was wondering if I was not missing something. Thanks in
advance for any answer,

Received on Monday, 21 January 2002 04:47:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC