A RetroSearch Logo

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

Search Query:

Showing content from https://webplatform.github.io/docs/dom/Selection/rangeCount below:

rangeCount ยท WebPlatform Docs

rangeCount Summary

Returns the number of ranges in a selection

Property of dom/Selectiondom/Selection

Syntax

Note: This property is read-only.

var rangecount = selObj.rangeCount;
Return Value

Returns an object of type NumberNumber

The number of ranges in a selection.

Examples
var selObj=window.selection();
var rangecount=selObj.rangeCount;
Notes Remarks

Windows Internet Explorer 9-11 does not currently support multiple or disjointed selections in standards mode. This property always returns a 1 with a valid selection. It returns a 0 if removeRange or removeAllRanges have been applied, though calling isCollapsed is recommended instead to detect an empty range.

Before the user has clicked a freshly loaded page, the rangeCount is 0. A user can normally only select one range at a time, so the rangeCount will usually be 1. Scripting can be used (currently) in Gecko to make the selection contain more than 1 range.

Syntax Standards information 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