-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
38 lines (36 loc) · 871 Bytes
/
index.html
File metadata and controls
38 lines (36 loc) · 871 Bytes
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
34
35
36
37
38
<!DOCTYPE html>
<html>
<head>
<!-- <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>-->
<meta charset=utf-8 />
<style>
body {
background:#ccc;
font-family: 'Arial', cursive;
font-weight:400;
}
body > div {
padding:50px;
}
</style>
</head>
<body id="copy">
<div>
<div class="copy">
<h1>HERE: <span id="paste"></span></h1>
<div>
<input type="text"/>
</div>
</div>
</div>
<script>
document.getElementById('copy').focus();
document.getElementById('copy').addEventListener('paste', (e) => {
e.preventDefault();
const text = (e.originalEvent || e).clipboardData.getData('text/plain');
console.log('PASTE: ', text);
document.getElementById('paste').innerHTML = text;
});
</script>
</body>
</html>