JSFiddle - React, Tailwind, and code Playground

by Diman0o

HTML

<script>window.onload = function(){ &nbsp; &nbsp;var canvas = 
document.getElementById('cv'); &nbsp; 
var ctx = canvas.getContext('2d');alert(ctx);
&nbsp;ctx.strokeStyle = 'red'; 
ctx.beginPath(); &nbsp; &nbsp; &nbsp;
ctx.arc(100, 100, 50, 0, Math.PI*2, true); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
ctx.stroke();
}</script>
<body>
<canvas id='cv' width=400 height=400></canvas>
-------------------------
если нужен круг а не окружность то вместо
ctx.strokeStyle = 'red'; пишем ctx.fillStyle = 'red';
ctx.stroke();пишем ctx.fill();