[whatwg] getElementsByIdPart

chriswa at comcast.net chriswa at comcast.net
Mon Aug 9 12:57:42 PDT 2004


Ok Zack or any one else on the list can you provide me with an example?  I've search the .net and I cannot find an example using XPATH that can provide a list of DOM elements matching an attribute substring.

Mind you I'm not saying that you cannot do that with an XML document.  You can but can you do this in an HTML DOM document?  In searching for a solution I found a JavaScript XPATH library but this is way too heavy and much more complicated than merely scanning the elements and using indexOf().

And only works if the document is a loaded XML document or if the page is an XHTML pages -- thus not backward compatible (unlikely to be supported by IE6).

I think it would be easier if there was a getElementsById(regExp) that can returns an array of elements.  The DOM already has the info and can scan the elements efficiently than JavaScript indexOf.

But I am open to suggesstions if you can provide me with an example.

Thanks,
Chris 


> On Wednesday 04 August 2004 23:41, Chris Waldron wrote:
> > Thus I think this is still a viable request to have built into the
> > DOM.
> 
> I don't think so. DOM3 XPath offers that and a lot more. 
> 
> Zack
> 
> -- 
> Question authority! Yeah, says who?



More information about the whatwg mailing list