Selection.selectAllChildren()
用法
sel.selectAllChildren(parentNode)
参数
parentNode
-
所有 parentNode 元素的子元素会被设为选中区域,parentNode 本身除外。
举例
footer = document.getElementById("footer"); window.getSelection().selectAllChildren(footer); /* Everything inside the footer is now selected *
规范
Specification |
---|
Selection API # dom-selection-selectallchildren |
浏览器兼容性
BCD tables only load in the browser
相关链接
Selection
, 此方法所属接口。