html5画四边形
<canvas id='test02'></canvas> <script> var canvas = document.getElementById('test02'); var context = canvas.getContext('2d'); context.moveTo(50, 0); context.lineTo(0, 50); context.lineTo(50, 100); context.lineTo(100, 50); context.lineTo(50, 0); context.stroke(); </script>