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.
 
     
    