title: HTML crossorigin attribute for img tag
body: <p>I am trying to understand how to use the crossorigin attribute for the img tag. I couldn't find a good example (The ones I found about CORS enabled images are explained with JavaScript codes, therefore I couldn't see the crossorigin attribute with the img tag.</p>
  
  <p>I have got a guess, please correct my mistakes if I understood something wrong. </p>
  
  <p>First of all one can write the code piece below to draw an image to canvas:</p>
  
  <pre><code>&lt;canvas id="canvas" width=400 height=400&gt;&lt;/canvas&gt;
  &lt;br&gt;&lt;br&gt;
  &lt;img id="image" src="http://...." alt="" width="400" height="400"&gt;
  &lt;script&gt;
  function draw() {
      var canvas = document.getElementById("canvas");
      var context = canvas.getContext("2d");
      var img = new Image();
      img.crossOrigin = "Anonymous";
      img.src = document.getElementById("image").value;
      context.drawImage(img, 40, 40);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Is the code below equivalent to the upper one? It doesn't include "img.crossOrigin" but have crossorigin attribute in the img tag.</p>
  
  <pre><code>&lt;canvas id="canvas" width=400 height=400&gt;&lt;/canvas&gt;
  &lt;br&gt;&lt;br&gt;
  &lt;img id="image" crossorigin="anonymous"src="http://...." alt="" width="400" height="400"&gt;
  &lt;script&gt;
  function draw() {
      var canvas = document.getElementById("canvas");
      var context = canvas.getContext("2d");
      var img = new Image();
      img.src = document.getElementById("image").value;
      context.drawImage(img, 40, 40);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>To tell the truth I cannot make experiments because I don't know what site allows to use its images as CORS.</p>
  
  <p>What I guess is that, if a site allow to use its images in canvas if the CORS request is done by anonymously you can draw it in canvas, if not you cannot draw it in canvas even if the request is done by anonymously (I am not sure if I am right here). Therefore both of the examples above must be requesting CORS anonymously.</p>
  
  <p>Could you please say if both of them works the same? If not, could you please explain why and give me an example using the crossorigin attribute with the img tag?</p>