Packagecssom.view
Interfacepublic interface TextRectangleList

Introduced in: DOM 0 

A collection of TextRectangle objects returned by the getClientRects method.

View the examples

See also

MSDN: TextRectangle Collection
W3C CSSOM Views Specification: TextRectangleList


Public Properties
 PropertyDefined By
  CSSOM View length : Number
[read-only] Returns the total number of TextRectangle objects associated with the object.
TextRectangleList
Public Methods
 MethodDefined By
  
CSSOM View item(index:Number):TextRectangle
Retrieves an object from a TextRectangle collection.
TextRectangleList
  
Non-Standard namedItem(name:DOMString):TextRectangle
Retrieves an object or a collection from a specified collection.
TextRectangleList
Property Detail
CSSOM View lengthproperty
length:Number  [read-only]

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 

Returns the total number of TextRectangle objects associated with the object.


Implementation
    public function get length():Number

See also

Method Detail
CSSOM View item()method
public function item(index:Number):TextRectangle

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a
Introduced in: DOM 0 

Retrieves an object from a TextRectangle collection.

Parameters

index:Number

Returns
TextRectangle — The TextRectangle object at that index

Throws
DOMException — INDEX_SIZE_ERR: May be raised if the index is negative or greater than the number of TextRectangle objects associated with the object.

See also

namedItem()method 
public function namedItem(name:DOMString):TextRectangle

Product Versions : Internet Explorer 5.5 Internet Explorer 6.0 Internet Explorer 7.0 Internet Explorer 8.0 as IE7 Internet Explorer 8.0 as IE8 Firefox 2.0 Firefox 3.0 Firefox 3.1b Safari 3.0 Safari 3.1 Safari 4.0b Chrome 1.0 Chrome 2.0 Opera 9.62 Opera 10.0a

Non-standard (Microsoft)

Retrieves an object or a collection from a specified collection.

Note (IE8): In IE8 mode, the namedItem method does not return collections if more than one named item is found; instead, it returns the first case-insensitive matched element.

Parameters

name:DOMString — The name or id property of the object to retrieve. A collection is returned if more than one match is made.

Returns
TextRectangle — Returns an object or a collection of objects if successful, or null otherwise.

See also


Example
         <div id="oDIV1">This text will not change.</div>
         <div id="oDIV2">This text will change.</div>
         <button onclick="document.all.namedItem('oDIV2').innerHTML='Changed!';">
         Change Option
         </button>
Examples
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>