Generation

translateThu, 01 Jun 2023

Draw a 200*200 green square on a 600*600 blue background

var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); ctx.fillStyle="#0000ff"; ctx.fillRect(0, 0, 600, 600); ctx.fillStyle="#00ff00"; ctx.fillRect(20,20,200,200);

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant