I'm trying to create a program with HMTL, just to create a canvas and draw in the canvas with Javascript. I need the program to run in a computer and in the tablet, so i want the canvas to adjust to the side of the monitor. I thought it would be just setting width and height of canvas to screen.width and screen.height, but in Chrome the canvas is bigger than the screen and I have the scrollbars to see the rest of the window with the canvas. What am I doing wrong?
<body>
<div id="main_div">
<canvas id="myCanvas" style="border:1px solid #000000;">
<script>
var canvas = document.getElementsByTagName('canvas')[0];
canvas.width = screen.width;
canvas.height = screen.height;
</script>
</canvas>
</div>
</body>