TAG
CSS
JavaScript
Result
Run
License
<canvas id="mycanvas" width="300" height="100"></canvas>
#set-wrapper > label { display: inline-block; min-width: 100px; } #set-wrapper > label > span { color: #FF0000; } #set-wrapper > pre { background-color: #ffeda5; padding: 10px; } #mycanvas { border: 1px solid #CCC; }
window.addEventListener("load", function() { const elCanvas = document.getElementById("mycanvas"); let context = elCanvas.getContext("2d"); context.beginPath(); context.fillStyle = "#FF0000"; context.rect(10, 10, 280, 80); context.fill(); });
Console
expand_less
License
License
by DevDic
Close