why my code is not function properly, check my code of starting in canvas

+3 paul gares · November 1, 2016

<!Doctype html>

<html lang="en">
<head>
<title>html5</title>
<meta charset="utf-8">
<script>

function doFirst(){ 
canv = document.getElementById('canvas'); canvas = canv.getContext('2d'); canvas.fillRect(10, 10, 50, 50); 

window.addEventListener("load", doFirst, false);

</script>
</head>
<body>
<section id="main">
<canvas id="canvas" width="600" height="400">
</canvas>
</section>
</body>
</html>

Post a Reply

Replies

Oldest  Newest  Rating
0 hashaam ahmad · January 19, 2017
your code is OK you just need to make a new page of java script and reference it on your main page....
  • 1

HTML / CSS / Web Design

131,279 followers
About

Discuss, share, ask, learn and teach HTML5 and CSS3.

Links
Moderators