title: TinyMCE textarea doesn't respond to 'onkeydown' event
body: <p>I'm trying to trigger a warning when the user leaves the page if he had made changes in the textareas of TinyMCE plugin.</p>
  
  <p>There's my code. It works if i use a normal form textarea, but it doesn't go well when i add the 'onkeydown' event to the tiny's textarea. I've comproved the value of 'cambios' with the browser console and i saw that it never changes its value.</p>
  
  <p>JS:</p>
  
  <pre><code>var cambios = false;
  
  function change_cambios (){ cambios = true;}
  
  window.onbeforeunload = function() {
      if(cambios) {
          return confirm('Are you sure?');
      }
      return;
  }    
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>    &lt;form id="formulari" method="post" &gt;
          &lt;textarea id="ap0sub2" name="area" onkeydown="change_cambios();"&gt;&lt;/textarea&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>That works perfectly if i use it within tinyMCE plugin. But when i include the text editor, the value of 'cambios' remains to false.</p>
  
  <p>Any ideas? </p>
  
  <p>Thanks a lot!</p>