A RetroSearch Logo

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

Search Query:

Showing content from https://developer.cdn.mozilla.net/en-US/docs/Web/API/Selection/removeRange below:

Selection: removeRange() method - Web APIs

Selection: removeRange() method

Baseline 2023

Newly available

The Selection.removeRange() method removes a range from a selection.

Syntax Parameters
range

A range object that will be removed from the selection.

Return value

None (undefined).

Examples
/* Programmatically, more than one range can be selected.
 * This will remove all ranges except the first. */
const s = window.getSelection();
if (s.rangeCount > 1) {
  for (let i = 1; i < s.rangeCount; i++) {
    s.removeRange(s.getRangeAt(i));
  }
}
Specifications Browser compatibility See also

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