title: how to resolve the canvas not supported error
body: <p>I am using HTML5 Canvas,javascript. I have made an page with the help of html5 canvas and javascript..But when I run it it gave me this error</p>
  
  <blockquote>
    <p>("Error=Unable to get the value of the property 'getContext': object
    is null or undefined")</p>
  </blockquote>
  
  <p>but it does not terminate the program..the program is running fine with this .</p>
  
  <pre><code> function draw(canvas0) {
       var canvas = canvas0;
       options = null;
  
       // Canvas good?
       if (canvas !== null &amp;&amp; canvas.getContext)
  
   }
  
  
   function initCanvas() {
       var canvas1 = document.getElementById('tutorial');
       var canvas2 = document.getElementById('tutorial1');
       var canvas3 = document.getElementById('tutorial2');
       var canvas4 = document.getElementById('tutorial3');
       var canvas5 = document.getElementById('tutorial4');
  
       draw(canvas1);
       draw(canvas2);
       draw(canvas3);
       draw(canvas4);
       draw(canvas5);
   }
  </code></pre>
  
  <p>this is where i am getting the id and returning these values </p>
  
  <pre><code>     &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
      &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;Speedometer HTML5 Canvas&lt;/title&gt;
      &lt;script src="script copy.js"&gt;
  
      &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body onload='initCanvas();'&gt;
  
          &lt;canvas id="tutorial" width="440" height="220" style="zoom:50%"&gt;
              Canvas not available.
          &lt;/canvas&gt;
          &lt;canvas id="tutorial1" width="440" height="220" style="zoom:50%"&gt;
              Canvas not available.
          &lt;/canvas&gt;
          &lt;canvas id="tutorial2" width="440" height="220" style="zoom:50%"&gt;
              Canvas not available.
          &lt;/canvas&gt;
          &lt;canvas id="tutorial3" width="440" height="220" style="zoom:50%"&gt;
              Canvas not available.
          &lt;/canvas&gt;
          &lt;canvas id="tutorial4" width="440" height="220" style="zoom:50%"&gt;
              Canvas not available.
          &lt;/canvas&gt;
  
          &lt;form id="drawTemp"&gt;
  
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>after seeing the answer given by <a href="https://stackoverflow.com/questions/6429225/javascript-null-or-undefined#comment14094488_6429443">kennebec</a> if have created change in my code</p>
  
  <p><code>if (canvas != null &amp;&amp; canvas.getContext)</code>.</p>
  
  <p>After using this line the getContext error is not coming ,But after executing the page that is after drawing the canvas it gives me new error ("Canvas Not Supported By Your Browser").Help me out here.</p>