title: How to use onchange, onmouseup event in codemirror text editor
body: <p>I am using my text editor as codemirror. Normally when I try to use dom event like <code>onmouseup, onchange, oninput</code> in textarea it works, but after integrating the codemirror, it is not working. Please tell me the correct way to invoke these events in my text editor.</p>
  
  <p>Without codemirror, it works.</p>
  
  <pre><code>&lt;textarea id="editor" rows="30" cols="100" onchange="myFunction()" onmouseup="second();"&gt;&lt;/textarea&gt;        
  &lt;div id="demo"&gt;&lt;/div&gt;
  &lt;div id="second"&gt;&lt;/div&gt; 
  &lt;script&gt;
    function myFunction() {
         document.getElementById('demo').innerHTML="The onchange function..";}    
    function second() {
         document.getElementById('second').innerHTML="The mouseup function..";}
  &lt;/script&gt;       
  </code></pre>
  
  <p>On integrating codemirror text editor, it is not working. Here is a code:</p>
  
  <pre><code>&lt;textarea id="editor" onchange="myFunction()" onmouseup="second();"&gt;&lt;/textarea&gt;
  &lt;div id="demo"&gt;&lt;/div&gt;
  &lt;div id="second"&gt;&lt;/div&gt; 
  &lt;script&gt;
      var editor = CodeMirror.fromTextArea
      (document.getElementById('editor'),{
              mode:"text/x-java",
              lineNumbers:true,
              autoCloseTags:true,
              tabSize:5       
      });
      editor.setSize("1000", "450");              
      &lt;/script&gt;       
      &lt;script&gt;
      function myFunction() {
            document.getElementById('demo').innerHTML="The onchange function..";}         
      function second() {
           document.getElementById('second').innerHTML="The mouseup function..";}
  
      &lt;/script&gt;
  </code></pre>