10 works

Replace Textarea with Codemirror editor

dashboard+ Project

Posted by @mishka #javascript

Code snippet:

<link rel="stylesheet" type="text/css" href="plugin/codemirror/lib/codemirror.css">

	<textarea class="codemirror-textarea"></textarea>


    var codeText = $(".codemirror-textarea")[0];
    var editor = CodeMirror.fromTextArea(codeText, {
        lineNumbers : true


<script type="text/javascript" src="plugin/codemirror/lib/codemirror.js"></script>
content_copyCopy to Clipboard

More details:

Download zip file from the website and add to plugin folder in your project.

Code snippet source:


>> Browse more code snippets