asp.net.ph

Skip Navigation Links

right Property

TextRectangle Properties   DHTML Object Properties


Retrieves the right coordinate of the rectangle surrounding the object content.

Syntax


HTML N/A
Script [ iCoord = ] oTextRectangle.right

Possible Values


iCoord Integer value representing the right coordinate of the rectangle, in pixels.

The property is read-only with no default value.

Remarks

Use the following syntax to access the right coordinate of the second text rectangle of a TextRange object:

oRct = oTextRange.getClientRects ( );
oRct [ 1 ] .right;

Note that the collection index starts at 0, so the second item index is 1.

Use the following syntax to access the right coordinate of the bounding rectangle of an element object:

oBndRct = oElement.getBoundingClientRect ( );
oBndRct.right;

Example

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 

Applies To

TextRectangle Object

See Also

TextRectangle Collection, TextRectangle Object, bottom, left, top



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note