<input id="foo" type="text" value="https://chupai.github.io/">
<button class="btn" data-clipboard-target="#foo">copy</button>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
}
console.clear();
const clipboard = new ClipboardJS('.btn');
This Pen doesn't use any external CSS resources.