Ask javascript to automatically copy the specified content to the pasteboard when the page is loaded.

when you click manually, you can copy the specified content to the pasteboard, and add an automatic loading page on this basis, how to achieve it?

< hr >
<body>
    

<input type="text" id="inputText" value="444"/> <input type="button" id="btn" value=""/> <hr> <textarea rows="4"></textarea> <script type="text/javascript"> var btn = document.getElementById("btn"); btn.addEventListener("click", function(){ var inputText = document.getElementById("inputText"); var currentFocus = document.activeElement; inputText.focus(); inputText.setSelectionRange(0, inputText.value.length); document.execCommand("copy", true); currentFocus.focus(); alert(""); }); </script> <script type="text/javascript"> window.onload=function(){ var btn = document.getElementById("btn"); btn.click(); document.execCommand("copy", true); } </script> </body>
Mar.16,2021
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-1e8b66a-5be6f.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-1e8b66a-5be6f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?