-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoding.html
More file actions
55 lines (37 loc) · 1.37 KB
/
Coding.html
File metadata and controls
55 lines (37 loc) · 1.37 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="StyleCode.css">
<title>Coding Ground</title>
</head>
<body>
<h1 id="headin"> <span> < </span> Welcome, Start your coding Journey here <span> /> </span> </h1>
<div class="container">
<div class="left">
<label >HTML</label>
<textarea id="html-block" onkeyup="run()"></textarea>
<label >CSS</label>
<textarea id="css-block" onkeyup="run()"></textarea>
<label >JavaScript</label>
<textarea id="js-block" onkeyup="run()"></textarea>
</div>
<div class="right">
<h3>Output / Result</h3>
<iframe id="output"></iframe>
</div>
</div>
<script>
function run(){
let htmlblock = document.getElementById("html-block").value;
let cssblock = document.getElementById("css-block").value;
let jsblock = document.getElementById("js-block").value;
let output = document.getElementById("output");
output.contentDocument.body.innerHTML = htmlblock+"<style>"+cssblock+"</style>";
output.contentWindow.eval(jsblock);
}
</script>
</body>
</html>