/
index.html
33 lines (31 loc) · 977 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>Test Page</title>
</head>
<body>
<header>
<a href="https://github.com/CompactJS/clipboard"
>@compactjs/clipboard - Demo</a
>
</header>
<main>
<button id="copy-string">Copy String</button>
<textarea id="input-text"></textarea>
<button id="copy-input">Copy from Input</button>
</main>
<script type="module">
import { clipboard } from './dist/index.module.js';
document
.getElementById('copy-string')
.addEventListener('click', () => clipboard('test' + Math.random()));
const inputText = document.getElementById('input-text');
document
.getElementById('copy-input')
.addEventListener('click', () => clipboard(inputText));
</script>
</body>
</html>