DHTML Methods
Retrieves a collection of objects that have the specified HTML tag name.
collElements = object.tags ( "sTag" )
sTag |
Required. String specifying an HTML tag. It can be any one of the objects exposed by the DHTML Object Model. |
Returns a collection of element objects if successful, or null otherwise.
This method returns an empty collection if no elements having the given name are found. Use the length property on the collection to determine the number of elements it contains.
The following JScript™ ( compatible with ECMA-262 language specification ) example retrieves a collection of all P elements in the document and then applies an underline to each.
var coll = document.all.tags ( "P" );
if ( coll != null ) {
for ( i = 0; i < coll.length; i++ )
coll [ i ].style.textDecoration = "underline";
}
all, anchors, applets, areas, boundElements, cells, childNodes, children, elements, embeds, filters, forms, frames, images, imports, links, options, plugins, rows, rules, scripts, styleSheets, tbodies