Selection.selectAllChildren()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.
语法
js
selectAllChildren(parentNode)
参数
parentNode
-
所有 parentNode 元素的子元素会被设为选中区域,parentNode 本身除外。
示例
js
footer = document.getElementById("footer");
window.getSelection().selectAllChildren(footer);
/* Everything inside the footer is now selected */
规范
Specification |
---|
Selection API # dom-selection-selectallchildren |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
selectAllChildren |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
参见
- 此方法所属的接口:
Selection
。