HTML, CSS, JS

Put you html-free code here and run it!

fork
loading
Files
  • index.html
  • randomLibrary.js
  • script.js
  • style.css
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>JsPad</title>
<style type="text/css" media="screen">
    #editor { 
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
</style>
</head>
<body id="main">

<div id="editor">function genNum(max){
    return Math.ceil(Math.random()*max);
}
alert(genNum(100))
</div>
<script src="randomLibrary.js"></script>
<script src="https://pagecdn.io/lib/ace/1.4.5/ace.js" type="text/javascript" charset="utf-8"></script>
<script>
    var editor = ace.edit("editor");
    editor.setTheme("ace/theme/monokai");
    editor.session.setMode("ace/mode/javascript");
		
		
		editor.commands.addCommand({
    	name: 'run',
    	bindKey: {win: 'Ctrl-R',  mac: 'Command-R'},
    	exec: function(editor) {
				var code=editor.getValue();
        eval(code);
    	},
    	readOnly: true // false if this command should not apply in readOnly mode
	});


</script>
</body>
</html>
result
console