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
- Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - 12th November 2024
- Visualizing local election results with Datasette, Observable and MapLibre GL - 9th November 2024
- Project: VERDAD - tracking misinformation in radio broadcasts using Gemini 1.5 - 7th November 2024