var x = document.getElementById("myCanvas"); var y = x.getContext("2d"); y.fillRect(10, 5, 100, 50);