This script uses both getElementsByTagName and getElementByTagName. It is a demonstration of the differences. Look carefully at the structure of the DIVs and those that are designated as element DIVs and those that are not. Click on each button to get a correlation of the number of paragraph tags and where they are in relation to the element DIVs. Then evaluate the source code yourself.