I'm sort of new to javascript and Ive been looking up documentElement, clientWidth & clientHeight and trying to figure out why its setting my canvas to the size of 300px by 150px. Maybe I'm not understanding something on how it's getting those dimensions. Can someone help explain?
Here is my current code
<canvas id="canvas"></canvas>
<script>
var canvas = document.getElementByID('canvas');
var ctx = canvas.getContext('2d');
canvas.width = document.documentElement.clientWidth;
canvas.height = document.documentElement.clientHeight;
</script>