Retrieving all DOM descendants
27th March 2003
First observation of the day: IE 5 for Windows doesn’t understand element.getElementsByTagName('*') to retrieve all descendants of an element in the DOM. element.all has the desired effect for that browser. So to retrieve all descendants in a way that will work on standards compliant browsers plus IE 5, the following seems to be the best bet:
var elements = element.all ? element.all : element.getElementsByTagName('*');
More recent articles
- 2025: The year in LLMs - 31st December 2025
- How Rob Pike got spammed with an AI slop "act of kindness" - 26th December 2025
- A new way to extract detailed transcripts from Claude Code - 25th December 2025