The App: I have a textarea element in my page. It is transformed using CodeMirror, because I need to indent and highlight html code withing it. Pic is in the li
Pass an onChange option to CodeMirror which looks something like this:
onChange: function (cm) {
mySecondTextArea.value = cm.getValue();
}
Edited to note: Since CodeMirror version 2.0, you don't pass an onChange option anymore to register a change handler, but call instance.on("change", function(cm, change) { ... }) instead. http://codemirror.net/doc/manual.html#event_change