File tree 3 files changed +64
-0
lines changed
3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 " />
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge " />
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
+ <!-- CSS Link -->
8
+ < link rel ="stylesheet " href ="style.css " />
9
+ < title > HTML, CSS and JavaScript Code Editor</ title >
10
+ </ head >
11
+ < body spellcheck ="false ">
12
+ < textarea id ="html " placeholder ="HTML "> </ textarea >
13
+ < textarea id ="css " placeholder ="CSS "> </ textarea >
14
+ < textarea id ="js " placeholder ="JavaScript "> </ textarea >
15
+ < iframe id ="code "> </ iframe >
16
+
17
+ < script type ="text/javascript " src ="script.js "> </ script >
18
+ </ body >
19
+ </ html >
Original file line number Diff line number Diff line change
1
+ function compile ( ) {
2
+ var html = document . getElementById ( 'html' ) ;
3
+ var css = document . getElementById ( 'css' ) ;
4
+ var js = document . getElementById ( 'js' ) ;
5
+ var code = 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 ( ) ;
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments