<textarea id="$name_textarea"></textarea>

<script>
	var $name = CodeMirror.fromTextArea($name_textarea, {
		mode: "javascript",
		lineNumbers: true,
		lineWrapping: true,
		extraKeys: {"Alt-F": "findPersistent"},
		foldGutter: true,
		gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
	});

	$name.setSize("100%","100%");
</script>