Answers for "how to copy something html"

26

javascript text to clipboard

function copyToClipboard(text) {
   const elem = document.createElement('textarea');
   elem.value = text;
   document.body.appendChild(elem);
   elem.select();
   document.execCommand('copy');
   document.body.removeChild(elem);
}
Posted by: Guest on March-20-2020
1

copy the text html

<div class="CopyMeClass" id="CopyMeID">The text to copy to the clipboard.</div>
<div><button onclick="CopyClassText()">Copy The Text</button></div>
Posted by: Guest on January-13-2021
1

copy the text html

<a class="cls_copy_pg_action copyAction copy-action-btn" data-value="THIS TEXT WILL BE COPIED"> <i class="far fa-copy"></i> Copy</a>
Posted by: Guest on January-13-2021
0

copy the text html

<script type="text/JavaScript">
//courtesy of BoogieJack.com
function killCopy(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=killCopy
document.onclick=reEnable
}
</script>
Posted by: Guest on January-13-2021

Code answers related to "how to copy something html"

Browse Popular Code Answers by Language