Edit in JSFiddle

var canvas = document.getElementById('canvas'),
    context = canvas.getContext('2d');

context.moveTo(0, 0);
context.lineTo(200, 200);
context.stroke();

context.moveTo(0, 200);
context.lineTo(200, 0);
context.stroke();
<canvas id="canvas" width="200" height="200"></canvas>
#canvas {
    border: 1px solid black;
}