Copy using javascript in proper way !
function copyme(e) {
e = e || window.event;
let target = e.target || e.srcElement;
// const text = target.previousElementSibling.innerHTML;
let text = e.target.value; // getting directly from input element
const el =
document.createElement('textarea');
el.value = text;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
}
Top comments (0)