Edit in JSFiddle

// DOM
var $md = document.getElementById( 'markdown' );
var $pr = document.getElementById( 'markdown-preview' );

// Markdown Renderer
var md = window.markdownit();

function mdRender() {
    // Render
    var cnv = md.render( $md.value );
    $pr.innerHTML = cnv;
}

// Keyup Event
$md.addEventListener( 'keyup', mdRender );
mdRender();
<div class="half-box half-left">
<p class="label">Markdown Input</p>
<textarea id="markdown"># Heading

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

## List Item

Which do you like ?

* Apple
* Orange
* Grape

## Table Item

Result.

| Name   | Result |
|:------:|-------:|
| Apple  |    25% |
| Orange |    30% |
| Grape  |    45% |

## Link

Search Engine.

* [Google](http://www.google.com/)
* [Yahoo!](http://www.yahoo.com/)
* [Bing](http://www.bing.com/)

## Code

```
var foo = 'bar';
function baz( qux ) {
    document.write( qux );
}
baz( foo );
```

</textarea>
</div>

<div class="half-box half-right">
<p class="label">Preview</p>
<div id="markdown-preview"></div>
</div>
html, body {
    height: 100%;
}
body {
    font: 16px/1.6 sans-serif;
    position: relative;
    margin: 0;
}

.half-box {
    width: 50%;
    height: 100%;
    position: relative;
    padding: 45px 10px 10px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    
    .label {
        position: absolute;
        left: 10px;
        top: 10px;
        margin: 0;
        background: #000;
        color: #fff;
        padding: 5px;
        font-size: .8em;
        opacity: .6;
    }
}
.half-left {
    float: left;
}
.half-right {
    float: right;
}

#markdown {
    padding: 5px;
    width: 100%;
    height: 99%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    border: 1px solid #ccc;
    font-size: .9em;
}

#markdown-preview {
    padding: 5px;
    height: 99%;
    border: 1px solid #ccc;
    overflow: auto;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    background: #fff;
    
    h1 {
        border-bottom: 1px solid #eee;
    }
    table {
        width: 100%;
        border-collapse: collapse;
        th {
            border: 1px solid #ccc;
            padding: 10px;
        }
        td {
            border: 1px solid #ccc;
            padding: 10px;
        }
    }
    pre {
        background: #eee;
        font-size: .9em;
        padding: 10px;
        font-family: monospace;
    }
}