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

getElementsBySelector()

From: Anne van Kesteren <fora@annevankesteren.nl>
Date: Sat, 28 Aug 2004 19:14:58 +0200
Message-ID: <4130BD92.3000000@annevankesteren.nl>
To: W3C CSS List <www-style@w3.org>
CC: www-dom@w3.org

I first proposed this on the WHATWG mailing list[1], but Ian told me I
could better address it here.

Simon Willison once made a sample implementation[2] of this function in
Javascript:

#   document.getElementsBySelector('div#main p a.external')
#
# This will return an array containing all of the links that have
# 'external' in their class attribute and are contained inside a
# paragraph which is itself contained inside a div with its id
# attribute set to 'main'.

I hope this made it clear how it should work.

Currently there are only methods available that require knowledge of 
XPath[3] (although that is just a note, not a real standard yet) by the UA.


[1]<http://listserver.dreamhost.com/pipermail/whatwg-whatwg.org/2004-August/001945.html>
[2]<http://simon.incutio.com/archive/2003/03/25/getElementsBySelector>
[3]<http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/>


-- 
  Anne van Kesteren
  <http://annevankesteren.nl/>
Received on Saturday, 28 August 2004 17:15:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:19:02 UTC