"When authors use the
canvas
element, they must also provide content that, when presented to the user, conveys essentially the same function or purpose as the bitmapcanvas
. This content may be placed as content of thecanvas
element. The contents of thecanvas
element, if any, are the element's fallback content." - WHATWG HTML5 Specification
What happens if someone viewing your brilliant new canvas
application is using an older browser and is unable to recognize your coding genius? Or what happens when someone uses assistive technologies? Let's take a look.
If, for some reason, a user's browser won't support the new canvas
element, it's up to us as developers to give them something valuable instead.
Here we can use an image as fallback.
<canvas id="clock" width="200" height="200"> <img src="images/clock.gif" width="200" height="200" alt="clock"/> </canvas>
Or text:
<canvas id="clock" width="200" height="200"> <p>clock<...