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
- Gemini 2.0 Flash: An outstanding multi-modal LLM with a sci-fi streaming mode - 11th December 2024
- ChatGPT Canvas can make API requests now, but it's complicated - 10th December 2024
- I can now run a GPT-4 class model on my laptop - 9th December 2024