<canvas id="canvas" width="1024" height="600" style="border: 1px solid #aaa;display:block;margin: 50px,auto;"></canvas>
<script type="text/javascript">
window.οnlοad=function(){
var canvas=document.getElementById("canvas");
var context=canvas.getContext("2d");
context.moveTo(100,100);
context.lineTo(600,100);
context.lineTo(600,500);
context.lineTo(100,500);
context.lineTo(100,100);
context.stroke();
}
</script>