asp.net.ph

Skip Navigation Links

left Property

TextRectangle Properties   DHTML Object Properties


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

Syntax


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

Possible Values


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

The property is read-only with no default value.

Remarks

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

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

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

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

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

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 )">
...
</body>

This feature requires Microsoft® Internet Explorer® 5.0 or later.

 Show me 

Applies To

TextRectangle

See Also

TextRectangle Collection, TextRectangle Object, bottom, right, 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