-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest2.html
More file actions
30 lines (30 loc) · 811 Bytes
/
test2.html
File metadata and controls
30 lines (30 loc) · 811 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
<!DOCTYPE html>
<html>
<head>
<title>HTML testing page</title>
<script>
async function renderClipboard() {
try {
const text = await navigator.clipboard.readText();
document.open();
document.write(text);
document.close();
} catch (error) {
const textarea = document.createElement('textarea');
textarea.placeholder = 'Paste your HTML here';
textarea.style.width = '100%';
textarea.style.height = '100vh';
document.body.appendChild(textarea);
textarea.focus();
textarea.addEventListener('input', () => {
document.open();
document.write(textarea.value);
document.close();
});
}
}
window.onload = renderClipboard;
</script>
</head>
<body></body>
</html>