0
3.7kviews
Using HTML5 draw canvas containing a star.

Subject: Advanced Internet Technology

Topic: Responsive web design with HTML5 and CSS3

Difficulty: High

1 Answer
2
4views
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>canvas</title>
</head>

<body>

<di class="can">
    <h1 onclick="drawstar()">canvas click to draw star</h1>
    <canvas id="canvas" width=300 height=300></canvas>
</di>
</body>
<script>

function drawstar() {

    var canvas = document.getElementById("canvas");
    var ctx = canvas.getContext("2d");

    function drawStar(cx, cy, spikes, outerRadius, innerRadius) { …

Create a free account to keep reading this post.

and 4 others joined a min ago.

Please log in to add an answer.