-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditor.html
More file actions
29 lines (25 loc) · 799 Bytes
/
editor.html
File metadata and controls
29 lines (25 loc) · 799 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Real Time Editor</title>
<script>
function refresh(){
var textContent = document.getElementById('editor-textarea').value;
document.getElementById('viewer').srcdoc = textContent;
}
</script>
<style>
* {padding: 0; margin: 0;}
.main{background: #ecf0f1; width:100%; height:100%; display: inline-flex;}
#editor-textarea{width:100%; margin:10px;}
#viewer{background: white; border:none; width:100%; margin:10px;}
</style>
</head>
<body>
<div class="main">
<textarea id="editor-textarea" onkeyup="refresh()"></textarea>
<iframe id="viewer"></iframe>
</div>
</body>
</html>