この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!
この記事を English (US) で読むこともできます。

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Range() constructor returns a newly created Range object whose start and end is the global Document object.

Syntax

range = new Range()

Example

range = new Range();
endNode = document.getElementsByTagName('p').item(3);
endOffset = document.getElementsByTagName('p').item(3).childNodes.length;
range.setEnd(endNode, endOffset);

Specification

Specification Status Comment
DOM
The definition of 'Range.Range()' in that specification.
Living Standard Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
Experimental
Chrome Full support YesEdge Full support YesFirefox Full support 24IE No support NoOpera Full support 15Safari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 24Opera Android Full support 15Safari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See also

ドキュメントのタグと貢献者

このページの貢献者: mfluehr, fscholz, bethge, teoli, jsx, kscarfone, Sheppy
最終更新者: mfluehr,