hahahanne
New Coder
Trying to complete a course in PHP, which involves Javascript. my code is 100% the same as my "Teachers" His code is working but mine isn´t... The course i am taking is 3 years old so i get no help from the instructor.. been stuck at this chapter for a week now and it´s driving me literally insane as i don´t understand JS at all...
everything is 100% same as the instructor at this stage his rectangle get filled in the middle by a red square, Where my JS won´t execute at all ? It makes no difference it´s just stuck with it´s #f4f4f4 background...
Code:
<!DOCTYPE html>
<html>
<head>
<title>Canvas</title>
<style>
#myCanvas{
border:1px #000 solid;
background:#f4f4f4;
}
</style>
</head>
<body>
<canvas id="myCanvas" width="300" height="300"></canvas>
<script>
var c = document.getElementById('myCanvas')
var ctx = c.getContext('2d');
//Rectangle
ctx.fillStyle='#34ebbd';
ctx.fillRect(75,75 150, 150);
</script>
</body>
</html>
everything is 100% same as the instructor at this stage his rectangle get filled in the middle by a red square, Where my JS won´t execute at all ? It makes no difference it´s just stuck with it´s #f4f4f4 background...
Last edited: