469,363 Members | 2,578 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,363 developers. It's quick & easy.

List all HTML-element in document

Hi all,

I'm looking for an alternate way to document.all to list all
HTML-elements on a webpage.

I'm trying to get all IDs on a page that starts with specific letters,
ie: <div class='classname' id='MEIT_Start'.....

I wan't to build an array of items starting with 'MEIT_'

I have tried to use getElementByID but no succes

suggestions??

reg.
Kjell Brandes

Nov 9 '06 #1
2 1733
kj**********@gmail.com wrote:
I'm looking for an alternate way to document.all to list all
HTML-elements on a webpage.
How about?

document.getElementsByTagName("*");
I'm trying to get all IDs on a page that starts with specific letters,
ie: <div class='classname' id='MEIT_Start'.....

I wan't to build an array of items starting with 'MEIT_'
Then you can loop through the elements returned by the above and test
the ID property for each to see if it begins with whatever prefix you wish.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
Nov 9 '06 #2
Thanks!

Dylan Parry skrev:
kj**********@gmail.com wrote:
I'm looking for an alternate way to document.all to list all
HTML-elements on a webpage.

How about?

document.getElementsByTagName("*");
I'm trying to get all IDs on a page that starts with specific letters,
ie: <div class='classname' id='MEIT_Start'.....

I wan't to build an array of items starting with 'MEIT_'

Then you can loop through the elements returned by the above and test
the ID property for each to see if it begins with whatever prefix you wish.

--
Dylan Parry
http://electricfreedom.org | http://webpageworkshop.co.uk

Programming, n: A pastime similar to banging one's head
against a wall, but with fewer opportunities for reward.
Nov 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.