title: Rotating an image made in javascript
body: <p>I want to rotate an image IN javascript. The variable used for the image in javascript is heroImage. I am using jquery rotate, it works fine only when rotating images in html, but not in javascript. Normally it looks something like this</p>
  
  <pre><code>$("#image").rotate(angle);
  </code></pre>
  
  <p>But that only works for images created in html.</p>
  
  <p>This is part of the code im currently using</p>
  
  <pre><code>var heroImage = new Image();
  heroImage.src = "images/hero.png";
  </code></pre>
  
  <p>and its drawn of canvas , if that helps. the problem is #image can only refer to a html div element afaik..
  The answer that im not looking for is this:</p>
  
  <pre><code>$("#image").rotate(angle);
  </code></pre>
  
  <p>Because that only works for html images </p>
  
  <p>Its for a game, so everything has to be in javascript , anything css related doesnt seem to work.
  It also  has to be IE9 compatible</p>