Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: Recursive function to find a node in the DOM Date: Sun, 19 Jul 2015 12:34:19 +0200 Organization: PointedEars Software (PES) Lines: 35 Message-ID: <1636165.RvOSKfTF1j@PointedEars.de> References: <5530725.v0RXNFEj4j@PointedEars.de> <4029225.tIX9iqhVEp@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1437302268 7836 eJwNxsEBwCAIA8CVgkIo42BL9h/B3uti0/imM+ih0GOwM8tVEGj5ZxOstsRXA4S02DjV45W8AdsQRA== (19 Jul 2015 10:37:48 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Sun, 19 Jul 2015 10:37:48 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNycEBADEEBMCWJFiUg9B/CXfzHWUctAkUoqvLkSSNrJ5HNn/lOqHWHJPCGy2eYLFK8ktPr5pxKZGcjfkAZkEVZA== Cancel-Lock: sha1:d+IcXVlJBDuMtD9FEzMBeRBj5zY= X-NNTP-Posting-Host: eJwNwoERADEEBMCWCM5rx4X+S8jPbhgUTEfAY39xazPH5Ta9oTSQl3p2VKy44iUnvtxunXkm2xGO Xref: csiph.com comp.lang.javascript:28454 Thomas 'PointedEars' Lahn wrote: > […] You can use the getElementsByName(…) method for that; > it is available on HTML document objects in implementations of W3C DOM > Level 2 HTML (since 2003) and HTML5. > > The getElementsByName(…) method is not available on element objects (at > least not in a standards-compliant way; implementations may vary); > however, the getElementsByTagName(…) method is, starting from IE/MSHTML > 5.5 at the latest. That method can be called as > element.getElementsByTagName("*"), and the resulting NodeList can be > filtered, if you do not want to be tied to a specific “tagName” property > value. If all else fails, the return value of > document.getElementsByTagName("*") can be filtered. [References that were accidentally cut from the draft: ] > Higher Levels of the W3C DOM, implemented in recent Web layout engines, > support other such methods that are more flexible, too: > document.evaluate(…) for XPath queries, and document.querySelector(…) and > document.querySelectorAll() for CSS queries. -- PointedEars FAQ: | SVN: Twitter: @PointedEars2 | ES Matrix: Please do not cc me. / Bitte keine Kopien per E-Mail.