Range.setStartAfter()

The Range.setStartAfter() method sets the start position of a Range relative to a Node. The parent Node of the start of the Range will be the same as that for the referenceNode.

语法

range.setStartAfter(referenceNode);

参数

referenceNode
The Node to start the Range after.

例子

var range = document.createRange();
var referenceNode = document.getElementsByTagName("div").item(0);

range.setStartAfter(referenceNode);

规范

Specification Status Comment
DOM
Range.setStartAfter()
Living Standard No change.
Document Object Model (DOM) Level 2 Traversal and Range Specification
Range.setStartAfter()
Obsolete Initial specification.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
setStartAfterChrome Full support YesEdge Full support 12Firefox Full support 4IE Full support 9Opera Full support 9Safari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

参见