title: Could not find element with id maincanvas in jQuery?
body: <p>This is the error I get</p>
  
  <pre><code>uncaught exception: Could not find element maincanvas
  </code></pre>
  
  <p>I have included the jQuery file and checked the spelling but error seems to be because of something else</p>
  
  <pre><code>&lt;a href="#" id="colorbtn" class="btn"&gt;Add Blue&lt;/a&gt;           
  &lt;canvas id="maincanvas"&gt;&lt;/canvas&gt;
  &lt;script type="text/javascript"&gt;
  var canvas = $('#maincanvas');
  var ctx    = canvas[0].getContext("2d");
  var $color      = $('#colorbtn');
  
  Caman('image.jpg','#maincanvas', function(){
  this.revert(false);
  this.render();
  });
  
  $color.on('click', function(e){
  e.preventDefault();
  Caman('image.jpg','#maincanvas', function(){
  this.colorize(60, 105, 218, 10);
  this.render();
  });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>What is causing this error?</p>