programming-examples/js/Drawing/Draw a rectangular shape.js
2019-11-15 12:59:38 +01:00

10 lines
323 B
JavaScript

function draw() {
var canvas = document.getElementById('canvas');
if (canvas.getContext) {
var context = canvas.getContext('2d');
context.fillRect(20,20,100,100);
context.clearRect(40,40,60,60);
context.strokeRect(45,45,50,50);
}
}