![]() | ![]() | ![]() |
| ||
|
tags
Description
Retrieves a collection of all elements in the given collection that have the given HTML tag name.
Syntax
elements = object.tags(tag)
Parameter Description tag String specifying the name of an HTML tag. It can be the name of any one of the elements listed in Objects. Return Value
Returns a collection of element objects if successful, or null otherwise.
Remarks
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.
Example
The following JScript example retrieves a collection of all P elements in the document, 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"; }Applies To
all, anchors, applets, areas, embeds, forms, images, links, plugins, scripts, styleSheets
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.