c0ldspark
1
Q:

copy text from header tag in javacript

function copyText() {
  var text = document.getElementById("myText").innerText;
  var elem = document.createElement("textarea");
  document.body.appendChild(elem);
  elem.value = text;
  elem.select();
  document.execCommand("copy");
  document.body.removeChild(elem);
}
0

Tags

New to Communities?

Join the community