IE9 Support for HTML5 Canvas tag

Shiraz Bhaiji picture Shiraz Bhaiji · Feb 16, 2011 · Viewed 36.1k times · Source

I am trying to test out the canvas tag, I started with this code:

<html>
 <canvas id="example" width="200" height="200">
    This text is displayed if your browser does not support HTML5 Canvas.
 </canvas>
</html>

In IE8 I get the message:

 This text is displayed if your browser does not support HTML5 Canvas.

I then installed IE9 but get the same error. Does IE9 support HTML5 canvas or not?

Edit

The problem was that I was missing the doctype tag

<!DOCTYPE html>

Answer

gor picture gor · Feb 16, 2011

IE9 does support canvas. Here is an exmaple.

If canvas does not work in your browser, press F12 (open developer tools), and make sure, that IE is not in compatibility mode.