Click to return to the DHTML, HTML     
tbodies Collection     DHTML Collections    
Web Workshop  |  DHTML, HTML & CSS

TextRectangle Collection


Returns a collection of TextRectangle objects.

Members

Remarks

The collection returns an empty collection for objects that do not have text.

If the window is resized, the collection is not updated. Because the collection is a snapshot of the layout, always update the collection following the onresize event.

The TextRectangle collection is available as of Microsoft® Internet Explorer 5.

Example

This example shows how to use the getClientRects method and the TextRectangle collection to iterate through the lines of text in an object.

<SCRIPT>
function newHighlite(obj) {            
  oRcts = obj.getClientRects();
  iLength = oRcts.length
  for (i = 0;i < iLength; i++)
  {
    alert("Line number " + (i + 1) + " is " + 
         (oRcts(i).right - oRcts(i).left) + " pixels wide.")
  }
}
</SCRIPT>

See Also

TextRectangle



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.