getElementsByTagName Method Sample

This sample uses the getElementsByTagName method to return a collection of child elements with the specified tag name.
Click one of the list items below.
The getElementsByTagName method is invoked on the parent element of the clicked item.
The first and last elements in the returned collection and the length of the collection are displayed in the table.