10 works

Replace Textarea with Codemirror editor


dashboard

Posted by @mishka #javascript

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

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

<script>

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

</script>

<script type="text/javascript" src="plugin/codemirror/lib/codemirror.js"></script>
content_copy

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

https://codemirror.net/

>> Browse more code snippets

more_vert