Let me give you an example. Now you have the following code:
<body>
<div>
<span>hahaha</span>
<div id="select">
<span>hahahaha</span>
</div>
</div>
</body>
I need to select the content where id is select and keep the original format to copy to the clipboard. How can I do this under JavaScript? I have tried the select function, but it is only useful for input tags. How to implement it for non-input tags