javascript – Como Disparar Pop Up Text Copy Text

                                leave copiarTexto = () => {
// O text that will be copiado
const texto = "10KITS239";
// Cried um input elemento (pode ser um textarea)
let inputTest = document.createElement ("input");
inputTest.value = texto;
// Anexa o elemento ao body
document.body.appendChild (inputTest);
// seleciona todo o texto do elemento
inputTest.select ();
// executa o comando copy
// view a copy of a work area with a database
document.execCommand (& # 39; copy & # 39;);
// remove the element
document.body.removeChild (inputTest);
};
.banner-cupom img {

viewing block;
upholstery: 10%;
upper margin: -70%;

}

.text-coupon {

font size: 1.3em;
upper margin: -30%;
White color;
lower margin: 20%;
text-align: center;
font weight: bold;

}

. button, button {
show: -webkit-inline-box;
color: #fff;
border: 1px solid # 72dafb;
border-radius: 10px;
lower margin: 10px;
text-align: center;
outline: 0;
background: # 72dafb;
font weight: bold;
padding left: 2nd;
padding on the right: 2em;
}

.Button: hover, button: hover {
cursor: pointer;
color: #fff;
color of the background: # f6bc70;
border color: # f6bc70;
text-decoration: none;
}