HTML and CSS Reference
In-Depth Information
}
}
function init(){
ctx = document.getElementById('canvas').getContext('2d');
canvas1 = document.getElementById('canvas');
canvas1.addEventListener('click',choose,false);
makedeck();
shuffle();
Set font
ctx.font="bold 20pt sans-serif";
ctx.fillText("Click on two cards to make a match.",10,20);
Display instructions
as text on canvas
ctx.fillText("Number of matches so far: 0",10,360);
Display the count
starttime = new Date();
starttime = Number(starttime.getTime());
}
</script>
</head>
<body onLoad="init();">
<canvas id="canvas" width="900" height="400">
Your browser doesn't support the HTML5 element canvas.
</canvas>
</body>
</html>
Search WWH ::




Custom Search