1238795-1-ref.html (422B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="UTF-8"> 5 <script> 6 function draw() { 7 var c = document.getElementById('c').getContext('2d'); 8 9 c.fillStyle = 'red'; 10 c.fillRect(0, 0, 200, 200); 11 12 c.fillStyle = 'lime'; 13 c.fillRect(0, 0, 100, 100); 14 } 15 </script> 16 </head> 17 <body onload="draw();"> 18 <canvas id='c' width='200' height='200'></canvas> 19 </body> 20 </html>