The JavaScript implementation selects everything under the specified html tag and copies it.

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

Mar.20,2021

document.getElementById('select').innerHTML // idselect
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e96b49-4eac9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e96b49-4eac9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?