W3C home > Mailing lists > Public > www-dom@w3.org > July to September 1998

Request: Element.getFirstElementWithTagName(String name);

From: Chris Hubick <maillist@chris.hubick.com>
Date: Mon, 21 Sep 1998 13:42:32 +0000 (GMT)
To: www-dom@w3.org
Message-ID: <Pine.LNX.3.96.980921133709.15845A-100000@chris.hubick.com>

All over the place I find myself doing:

NodeList nl = anElement.getElementsByTagName("TAG");
Element e = (Element) nl.item(0);

So I would like to request a convenience method:

Element.getFirstElementWithTagName(String name);

allowing:

Element e = anElement.getFirstElementWithTagName("TAG");

Much thanks for your consideration!

---
Chris Hubick
mailto:chris@hubick.com
http://www.hubick.com/
Received on Monday, 21 September 1998 16:48:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT