Answers for "clipboard js usage for clipboard copy"


javascript copy to clipboard

function copyToCliBoard() {
  var copyText = document.getElementById("myInput");;
  copyText.setSelectionRange(0, 99999); /* For mobile devices */
  alert("Copied the text: " + copyText.value);

<input type="text" value="Hello World" id="myInput">
<button onclick="copyToCliBoard()">Copy text</button>
Posted by: Guest on March-15-2021

javascript copy clipboard

<a href="' + artworkUrl + '" onclick="copyURI(event)">Copy cover URL</a>
Posted by: Guest on June-09-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language