TextRectangle Properties DHTML Object Properties
Retrieves the bottom coordinate of the rectangle surrounding the object content.
HTML |
N/A |
Script |
[ iCoord = ] oTextRectangle.bottom |
iCoord |
Integer value representing the bottom coordinate of the rectangle, in pixels. |
The property is read-only with no default value.
Use the following syntax to access the bottom coordinate of the second text rectangle of a TextRange object:
oRct = oTextRange.getClientRects ( );
oRct [ 1 ] .bottom;
Note that the collection index starts at 0, so the second item index is 1.
Use the following syntax to access the bottom coordinate of the bounding rectangle of an element object:
oBndRct = oElement.getBoundingClientRect ( );
oBndRct.bottom;
The example below demonstrates the use of the getBoundingRect method to retrieve the coordinates of the bounds of the text rectangles within the element.
<script language="JavaScript">
function getCoords ( oObject ) {
oBndRct=oObject.getBoundingClientRect ( );
alert ( "Bounding rectangle = \nUpperleft coordinates: "
+ oBndRct.left + " " + oBndRct.top +
"\nLowerright coordinates: "
+ oBndRct.right + " " + oBndRct.bottom );
}
</script>
</head>
<body>
<P id=oPara onclick="getCoords ( this )">
This feature requires Microsoft® Internet Explorer® 5.0 or later.
Show me
TextRectangle Object
TextRectangle Collection, TextRectangle Object, left, right, top