This script uses getElementsByTagName. This shows that getElementsByTagName does not care where the elements are you are tring to get. Look carefully at the structure of the DIVs and those that are designated as element DIVs and those that are not. Click on the button to get a number of paragraph tags in the document. Then evaluate the source code yourself.