这篇翻译不完整。请帮忙从英语翻译这篇文章

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

Selection.selectAllChildren()把指定元素的所有子元素设为选中区域,并取消之前的选中区域。

用法

sel.selectAllChildren(parentNode)

参数

parentNode
所有parentNode元素的子元素会被设为选中区域,parentNode本身除外。

举例

footer = document.getElementById("footer");
window.getSelection().selectAllChildren(footer);
/* Everything inside the footer is now selected *

详细

说明 状态 注释
HTML Editing APIs
Selection.selectAllChildren()
Editor's Draft Initial definition
Selection API
Selection.selectAllChildren()
Working Draft Current

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
selectAllChildren
Experimental
Chrome Full support YesEdge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

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

相关链接

文档标签和贡献者

此页面的贡献者: 1v9, mdnwebdocs-bot, inottn, corlin
最后编辑者: 1v9,