I have an array that contains all elements on the page. How would I test if an element is childless while looping through the array? I would prefer to stay with standard javascript. Here is pseudocode that explains it:
for each element in elementlist:
if element is childless:
do something
else:
do something different
You can use hasChildNodes method which returns a boolean