when i was writting
let paintbox = document.getElementById('paintBox');
console.log(paintbox);
in the vs code it gives me null
but when i paste the same lines in console directly , then canvas is accesed
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Game1</title>
<script src="Logic.js"></script>
</head>
<body>
<h1>Canvas Game1</h1>
<canvas id='paintBox' height="500" width="500" style="border: 1px solid #000000"></canvas>
</body>
</html>
Javascript
let paintbox = document.getElementById('paintBox');
console.log(paintbox);
i checked logic.js is connected to html
what is the error here unable to find
plz help
thanks
github link of code