<!DOCTYPE html>
<html>
<head>
<title></title>
<style>
body{
background:#dddddd;
}
#canvas{
margin:10px;
padding:10px;
background: #ffffff;
border:thin inset #aaaaaa;
}
</style>
</head>
<body>
<canvas id="canvas" width='600' heihgt='300'>
Canvas not supported
</canvas>
<script type="text/javascript" src="example.js"></script>
</body>
</html>
1-1.html
var canvas=document.getElementById("canvas");
var context=canvas.getContext('2d');
context.font='32pt Arial';
context.fillStyle='cornflowerblue';
context.strokeStyle='red';
context.fillText('Hello Canvas',canvas.width/2-150,canvas.height/2+15);
context.strokeText('Hello Canvas',canvas.width/2-150,canvas.height/2+15);
example.js