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.

Using the DHTML Object Model: var aDivs = document.body.all.tags("div");
Using the DOM:var aDivs = document.body.getElementsByTagName("div");
First child
Last child
Length Item
[Frames Site Entry Point]
[MVC Entry Point]
[Site Entry Point]

SignalR: Form Using KnockOut
ModelViewController: Standard Razor