var delayBecauseFirebase = 1000;
setTimeout(function() {
var buttonShowJ = document.getElementById("buttonShow");
var messagesInJ = document.getElementById("messagesIn");
if(buttonShowJ)
{
buttonShowJ.addEventListener("click",function(){
var info = messagesInJ.innerHTML.replace(`<button id="buttonShow">Copy</button>`,"");
info.select(); \**(!HERE, because that doesnt works)**
document.execCommand("copy");
});
}else{
console.log("error");
}
}, delayBecauseFirebase);
I want to select the "text" inside info to can do
document.execCommand("copy");
But i dont know how can i use select for that var.
question from:
https://stackoverflow.com/questions/65600763/how-can-i-select-a-variable-to-copy 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…