Javascript: How do i get ALL elements in a document?

Sureshot324

Diamond Member
Feb 4, 2003
3,370
0
71
I know i can get an array of all elements with a certain tag with document.getElementsByTagName, but is there a way to just get ALL the elements in the entire document?
 

GullyFoyle

Diamond Member
Dec 13, 2000
4,362
11
81
You might be able to learn something here. The article starts with getElementsByTagName, but goes several steps beyond.
 

sunase

Senior member
Nov 28, 2002
551
0
0
You can pass "*" to getElementsByTagName, although I think you lose MSIE 5 compatibility.