How to set a value of CodeMirror editor by javascript?

Dmitry picture Dmitry · Dec 4, 2011 · Viewed 8.6k times · Source

How to set a value of CodeMirror editor by javascript command? I just need to set a text to it. But how?.. Thanks a lot for the help!

Answer

Felix Kling picture Felix Kling · Dec 4, 2011

It is explained in the manual, section Programming API:

setValue(string): Set the editor content.