Closed Thread Icon

Topic awaiting preservation: loop through all page elements (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8846" title="Pages that link to Topic awaiting preservation: loop through all page elements (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: loop through all page elements <span class="small">(Page 1 of 1)</span>\

 
smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 09-04-2003 12:51

Hi guys,

I have another question for you, what is the easiest and most efficient way to loop through all elements in an html page? I know you can build loops based on getElementsByTagName() etc. But how do you just loop through ALL elements?

Thanks,

Jon

rickindy
Nervous Wreck (II) Inmate

From: Indianapolis, In USA
Insane since: Jan 2002

posted posted 09-04-2003 14:57

document.getElementsByTagName("*") should do it

Few problems in life can't be solved by chocolate

smonkey
Paranoid (IV) Inmate

From: Northumberland, England
Insane since: Apr 2003

posted posted 09-04-2003 15:41

thanks - works a treat, i'd never even thought about an asterisk wildcard, just assumed it didn't work

« BackwardsOnwards »

Show Forum Drop Down Menu