On the query page, the copy button can only copy the content of the div above. How to copy the content below? ? ? please. . . . . .
## range.selectNode(document.getElementById('content'));
const selection = window.getSelection();
const selection = window.getSelection();
## const selection = window.getSelection();
## document.execCommand('copy');
alert("Copying [legal representative] successfully!");
</li>
</ul>
</div>
<div class="col-md-6 footer-grid">
<h4 class="footer-head"> </h4>
<ul>
<li><p style="text-indent: -5em;margin-left: 5em">Establishment date: {$art.clrq}
& lt;/li & gt;
& lt; li & gt; & lt; p style = "text-indent: -5em; margin-heft: 5EM" & gt; approval date: {$ Art.hzrq}
</li>
}
</li>
="content3">{$art.jycs}</span>
</li>
</ul>
</div>
##
WBOY2023-06-29 10:59:55
Shallow copy: Use `Object.assign()` or the spread operator `...` to copy an object, use `Array.from()` or the spread operator `...` to copy an array. For example:
let obj1 = { name: 'Alice', age: 20 }; let obj2 = Object.assign({}, obj1); // 浅拷贝对象 console.log(obj2); // 输出{ name: 'Alice', age: 20 } let arr1 = [1, 2, 3]; let arr2 = [...arr1]; // 浅拷贝数组 console.log(arr2); // 输出[1, 2, 3]
-Deep copy: Use `JSON.parse()` and `JSON.stringify()` to implement deep copy. For example:
let obj1 = { name: 'Alice', age: 20 }; let obj2 = JSON.parse(JSON.stringify(obj1)); // 深拷贝对象 console.log(obj2); // 输出{ name: 'Alice', age: 20 } let arr1 = [1, 2, [3, 4]]; let arr2 = JSON.parse(JSON.stringify(arr1)); // 深拷贝数组 console.log(arr2); // 输出[1, 2, [3, 4]]