A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/dom/TextRange/boundingTop below:

boundingTop · WebPlatform Docs

boundingTop Summary

Retrieves the distance between the top edge of the rectangle that bounds the TextRange object and the top side of the object that contains the TextRange.

Property of dom/TextRangedom/TextRange

Syntax

Note: This property is read-only.

var result = textRange.boundingTop;
Return Value

Returns an object of type NumberNumber

the top coordinate of the bounding rectangle, in pixels.

Examples

This example retrieves the value of the boundingTop property for the given text area.

<script type="text/javascript">
function boundDim(oObject)
{
    var oTextRange = oObject.createTextRange();
    if (oTextRange != null) {
        alert("The bounding top is \n" +
            oTextRange.boundingTop + oObject.scrollTop);
    }
}
</script>
</head>
<body>
<textarea cols="100" rows="2" id="oTextarea"
    onclick="boundDim(this)"> . . . </textarea>

View live example

Notes Remarks

Note If the TextRange is inside a textArea object, add the value of the element’s scrollTop property to the value of boundingTop.

Syntax Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4