read and write files....

I really enjoyed codemirror, and is works great. and one thing I’m having trouble to write code to autoload files for use to read and write the files.

I have four text areas, for .html, .css, .js and preview text areas but having trouble how to link each text area to the file to load files in text area.

Many thanks for your help.

here is code…

<link rel="stylesheet" href="//">

* {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;

html, body {
	width: 100%; height: 100%;

#wrap {
	width: 100%;
	height: 100%;

/* Code Editors */

#code_editors {
	position: absolute;
	top: 0; left: 0; bottom: 0; right: 60%;

#code_editors .code_box {
	height: 33%; width: 100%;
	position: relative;
.code_box h3 {
	font-size: 13px;
	height: 30px;
	padding: 5px 10px; margin: 0;
	background: linear-gradient(#707070, #555);
	color: white;
	border-top: 1px solid #8F8F8F;
	border-bottom: 1px solid #202020;
.code_box textarea {
	position: absolute;
	left: 0; right: 0; top: 30px; bottom: 0;
	resize: none; border: 0;
	padding: 10px;
	font-family: monospace;
.code_box textarea:focus {
	outline: none;
	background: #EFEFEF;

/* Output Area */
#output {
	position: absolute;
	left: 40%; top: 0; right: 0; bottom: 0;
	border: 5px solid #444;
	border-left-width: 10px;
	overflow: hidden;

#output iframe {
	width: 100%; height: 100%;
	border: 0;
<div id="wrap">

  <!-- Code Editors -->
  <section id="code_editors">
    <div id="html" class="code_box">
      <textarea name="html"></textarea>
    <div id="css" class="code_box">
      <textarea name="css"></textarea>
    <div id="js" class="code_box">
      <textarea name="js"></textarea>
  <!-- Sandboxing -->
  <section id="output">

<script src="//"></script>

<!-- For HTML/XML -->
<script src="//"></script>
<script src="//"></script>

<!-- For CSS -->
<script src="//"></script>

<!-- For JS -->
<script src="//"></script>
<script src="js/js.js"></script>

Reading and writing files is outside of the scope of this library’s functionality, you’ll have to implement that yourself and/or use different libraries.