5 <script type=
"text/javascript">
6 function bodyonload() {
7 var canvas
=document
.getElementById('test');
8 var ctx
= canvas
.getContext("2d");
9 ctx
.fillStyle
= 'green';
10 ctx
.fillRect(-1, 50, 151, 50); // left at -1
11 ctx
.fillStyle
= 'red';
12 ctx
.rect(-1, 100, 151, 50); // left at -1
14 ctx
.fillStyle
= 'blue';
15 ctx
.fillRect(0, 150, 150, 50); // left at 0
19 <body onload=
"bodyonload();">
20 <canvas id=
"test" width=
"200" height=
"200"></canvas>