0

I am using codeMirror plugin for syntax highlighting.My code is generating on button click dynamically.So I need to replace the existing code each button click.i have tried refresh() function but it isn't working.is there any other way to replace whole code on button click??

Below is the code:-

var editor = CodeMirror.fromTextArea(document.getElementById("ebot_code_f‌​ull_width"), { lineNumbers: true, mode: "text/x-c++src", matchBrackets: true, }); 
editor.setValue(ebotCode); 
var tocm = document.getElementById("ebot_code_full_width"); 
var cminst = CodeMirror.fromTextArea(tocm); 
cminst.refresh();
Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98
Nighina t t
  • 140
  • 1
  • 4
  • 15
  • 1
    Please show what you've tried so far. – 31piy Feb 22 '17 at 04:46
  • Possible duplicate of [JavaScript / CodeMirror - refresh textarea](http://stackoverflow.com/questions/5364909/javascript-codemirror-refresh-textarea) – 4b0 Feb 22 '17 at 04:53

0 Answers0