Selection.selectAllChildren方法
Selection.selectAllChildren简介
将指定节点的所有子节点加到当前selection中,这个操作将会丢失之前选择的内容。
语法
sel.selectAllChildren(parentNode)
参数
-
parentNode
-
选中parentNode参数的所有子元素,但是
parentNode
不会包含在当前selection中。
示例
footer = document.getElementById("footer"); window.getSelection().selectAllChildren(footer); /* 选中footer中的所有子元素*/
来源:https://developer.mozilla.org/en-US/docs/Web/API/Selection.selectAllChildren
加支付宝好友偷能量挖...
原创文章,转载请注明出处:Selection.selectAllChildren方法