Horje
Javascript copy text onclick Code Example
Javascript copy text onclick
const span = document.querySelector("span");

span.onclick = function() {
  document.execCommand("copy");
}

span.addEventListener("copy", function(event) {
  event.preventDefault();
  if (event.clipboardData) {
    event.clipboardData.setData("text/plain", span.textContent);
    console.log(event.clipboardData.getData("text"))
  }
});




Whatever

Related
how do you calculate velocity Code Example how do you calculate velocity Code Example
how to take screenshot only of a particular part Code Example how to take screenshot only of a particular part Code Example
windows snipping tool Code Example windows snipping tool Code Example
what is your team velocity Code Example what is your team velocity Code Example
firebase auth update Code Example firebase auth update Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8