title: How to draw canvas in wordpress editor
body: <p>I am trying to draw canvas in wordpress editor. 
  In "Pages" with a custom made button for my plugin I can add the canvas using: </p>
  
  <pre><code>wp.media.editor.insert('&lt;canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"&gt;canvas test &lt;/canvas&gt;');
  </code></pre>
  
  <p>but when I am trying to draw something in the canvas it does not work.</p>
  
  <pre><code>var c = document.getElementById("myCanvas");
  var ctx = c.getContext("2d");
  ctx.font = "30px Georgia";
  ctx.fillText("test", 90, 50);
  </code></pre>
  
  <p>I'm not sure why it cannot find the canvas in order to draw it. </p>