Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>canvas demo</title>
</head>
<body>
  <canvas id="mycanvas"></canvas>
</body>
</html>
 
*{
  margin:0;
  padding:0;
  outline:0;
  border:0;
  box-sizing:border-box;
}
canvas{
  border:2px solid #eee;
}
 
var mycanvas = document.getElementById('mycanvas');
mycanvas.width = 400;
mycanvas.height = 200;
var ctx = mycanvas.getContext('2d');
ctx.fillStyle = '#555';
ctx.fillRect(0,0,100,30);
ctx.font = "30px Calibri";
ctx.fillText("Hello World!", 200, 40);
ctx.strokeStyle = '#999';
ctx.arc(30, 60, 30, 0, Math.PI*2);
ctx.stroke();
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
ginny315pro
0viewers