tags Method
Retrieves a collection of objects that have the specified HTML tag name.
Syntax
collElements = object.tags(sTag)
Parameters
sTag Required. String that specifies an HTML tag. It can be any one of the objects exposed by the DHTML Object Model.
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
This example uses the tags method to retrieve a collection of all P elements in the document, and then uses the textDecoration property to underline each element.
<SCRIPT LANGUAGE="JScript"> var coll = document.all.tags("P"); if (coll!=null) { for (i=0; i<coll.length; i++) coll[i].style.textDecoration="underline"; } </SCRIPT>
Applies To
[ Object Name ] Platform Version Win16: Win32: Mac: Unix: WinCE: Version data is listed when the mouse hovers over a link, or the link has focus. all, anchors, applets, areas, boundElements, cells, children, elements, embeds, forms, images, links, options, plugins, rows, scripts, tbodies
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use.