<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>//<![CDATA[
window.onload=function(){
var context = canvas.getContext("2d");
context.strokeStyle = '#000000';
context.fillStyle = '#000000';
context.moveTo(10, 10);
context.lineTo(50, 10);
context.save();
context.lineWidth = 15;
context.moveTo(10, 30);
context.lineTo(50, 30);
context.restore();
context.moveTo(10, 50);
context.lineTo(50, 50);
context.stroke();
}//]]>
</script>
</head>
<body>
<canvas id="canvas" height="400" width="600">
</canvas>
</body>
</html>
The code above is rendered as follows: