Skip to content

Commit 99979df

Browse files
authored
first commit
0 parents commit 99979df

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

index.html

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!DOCTYPE html>
2+
<htmllang="en">
3+
<head>
4+
<metacharset="UTF-8" />
5+
<metahttp-equiv="X-UA-Compatible" content="IE=edge" />
6+
<metaname="viewport" content="width=device-width, initial-scale=1.0" />
7+
<!-- CSS Link -->
8+
<linkrel="stylesheet" href="style.css" />
9+
<title>HTML, CSS and JavaScript Code Editor</title>
10+
</head>
11+
<bodyspellcheck="false">
12+
<textareaid="html" placeholder="HTML"></textarea>
13+
<textareaid="css" placeholder="CSS"></textarea>
14+
<textareaid="js" placeholder="JavaScript"></textarea>
15+
<iframeid="code"></iframe>
16+
17+
<scripttype="text/javascript" src="script.js"></script>
18+
</body>
19+
</html>

script.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
functioncompile(){
2+
varhtml=document.getElementById('html');
3+
varcss=document.getElementById('css');
4+
varjs=document.getElementById('js');
5+
varcode=document.getElementById('code').contentWindow.document;
6+
7+
document.body.onkeyup=function(){
8+
code.open();
9+
code.writeln(
10+
html.value+
11+
'<style>'+
12+
css.value+
13+
'</style>'+
14+
'<script>'+
15+
js.value+
16+
'</script>'
17+
);
18+
code.close();
19+
};
20+
}
21+
22+
compile();

style.css

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
body {
2+
text-align: center;
3+
}
4+
5+
textarea {
6+
width:32%;
7+
float: top;
8+
min-height:250px;
9+
overflow: scroll;
10+
margin: auto;
11+
display: inline-block;
12+
background:#f4f4f9;
13+
outline: none;
14+
font-family: Courier, sans-serif;
15+
font-size:14px;
16+
}
17+
18+
iframe {
19+
bottom:0;
20+
position: relative;
21+
width:100%;
22+
height:35em;
23+
}

0 commit comments

Comments
 (0)
close