<canvas id="myCanvas" width=”300” height=”200” style="border:1px solid #c3c3c3;"> Your browser does not support the canvas element. </canvas> <script type="text/javascript"> var myCanvas = document.getElementById("myCanvas"); if (!myCanvas.getContext) { alert("你的浏览器不支持Canvas."); } else { alert("你的浏览器支持Canvas."); } </script>