Answers for "copy in 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
11

js copy text to clipboard

function copy() {
  var copyText = document.querySelector("#input");
  copyText.select();
  document.execCommand("copy");
}

document.querySelector("#copy").addEventListener("click", copy);
Posted by: Guest on September-17-2019
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
0

copy and paste html

Go to w3schools.com
Posted by: Guest on April-22-2021

Browse Popular Code Answers by Language