real time html editor - Free Download Real-time HTML Code Editor With jQuery And CodeMirror

Free Download Real-time HTML Code Editor With jQuery And CodeMirror

Posted on

This time I will share jQuery Plugin and tutorial about Real-time HTML Code Editor With jQuery And CodeMirror, hope it will help you in programming stack.

real time html editor - Free Download Real-time HTML Code Editor With jQuery And CodeMirror
File Size: 3.28 KB
Views Total: 687
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A free, easy-to-use, real-time, online HTML/CSS/JavaScript code editor(playground & sandbox) with instant live preview.

Built on top of jQuery library and CodeMirror text editor.

More Features:

  • Autocompletion hints.
  • Line numbers.
  • Custom key map.
  • Custom tab size.
  • Code validation.
  • Responsive and mobile-friendly.
  • And more via CodeMirror addons & configs.

How to use it:

1. Load the necessary JavaScript and CSS files in the document.

01 <!-- Code Mirror Stylesheet -->
02 <link rel="stylesheet" href="/path/to/cdn/codemirror.min.css">
03 <link rel="stylesheet" href="/path/to/cdn/theme/material-ocean.css"></link>
04 <link rel="stylesheet" href="/path/to/cdn/addon/hint/show-hint.css">
05  
06 <!-- HTML Editor Stylesheet -->
07 <link rel="stylesheet" href="css/main.css">
08  
09 <!-- jQuery -->
11  
12 <!-- Code Mirror JavaScript -->
13 <script src="/path/to/cdn/codemirror.min.js"></script>
14 <script src="/path/to/cdn/mode/xml/xml.js"></script>
15 <script src="/path/to/cdn/mode/javascript/javascript.js"></script>
16 <script src="/path/to/cdn/mode/css/css.js"></script>
17 <script src="/path/to/cdn/mode/htmlmixed/htmlmixed.js"></script>
18 <script src="/path/to/cdn/addon/edit/matchbrackets.js"></script>
19 <script src="/path/to/cdn/addon/hint/show-hint.js"></script>
20 <script src="/path/to/cdn/addon/hint/javascript-hint.js"></script>
21 <script src="/path/to/cdn/addon/hint/html-hint.js"></script>
22 <script src="/path/to/cdn/addon/hint/xml-hint.js"></script>
23 <script src="/path/to/cdn/addon/hint/css-hint.js"></script>
24 <script src="/path/to/cdn/keymap/sublime.js"></script>
25  
26 <!-- HTML Editor JavaScript -->
27 <script src="js/main.js"></script>

2. Create a textarea element for the code editor.

1 <div id="main">
2   <textarea id="editor">
3   ...
4   </textarea>
5 </div>

3. Create an iframe output for the live preview. That’s it.

1 <div id="main">
2   <textarea id="editor">
3   ...
4   </textarea>
5   <div id="output">
6     <iframe id="result"></iframe>
7   </div>
8 </div>