TextRectangle Collection

DHTML, HTML, & CSS

 
Click to return to the DHTML, HTML & CSS home page    
tbodies Collection     DHTML Collections    

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!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.