-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (20 loc) · 776 Bytes
/
script.js
File metadata and controls
24 lines (20 loc) · 776 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
var j=0;
//Function for live Rendering
function update(i) {
if(i==0){
let htmlCode=document.getElementById("htmlCode").value;
let cssCode=document.getElementById("cssCode").value;
let javascriptCode=document.getElementById("javascriptCode").value;
let text=htmlCode+"<style>"+cssCode+"</style>"+"<scri"+"pt>"+javascriptCode+"</scri"+"pt>";
let iframe=document.getElementById('viewer').contentWindow.document;
iframe.open();
iframe.write(text);
iframe.close();
}
else if(i==1){
let htmlCode=document.getElementById("htmlCode").value;
let html=htmlCode.slice(0,htmlCode.length);
document.getElementById("htmlCode").value=html;
j=1;
}
}