make a circle in javascript
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Draw a circle</title>
</head>
<body onload="draw();">
<canvas id="circle" width="150" height="150"></canvas>
</body>
</html>function draw()
{
var canvas = document.getElementById('circle');
if (canvas.getContext)
{
var ctx = canvas.getContext('2d');
var X = canvas.width / 2;
var Y = canvas.height / 2;
var R = 45;
ctx.beginPath();
ctx.arc(X, Y, R, 0, 2 * Math.PI, false);
ctx.lineWidth = 3;
ctx.strokeStyle = '#FF0000';
ctx.stroke();
}
}
Also in HTML:
- html
- html special characters
- flex center bootstrap
- jquery replace innerhtml
- html specific class color
- html create an image link
- ubuntu vm workstation 12
- htmls white space
- basecamp 3 api tag mention
- background image html
- text shadow effect html
- possible colors used for html
- vscode-jest intellisense not working
- There is no formatter for 'django-html' files installed.
- Google go to sprint in Encino
- html doctype declaration
- how to customize link text in html
- how to add space in html
- how to add set between two date in datatable
- how to gather true or false value from html checkbox in javascript
- html form select
- how to open a new html page on button click in javascript
- html background image fit to screen
- Show html when a list in the dropdown is selected