Here is my code, I feel like I have tried everything but nothing is affecting the canvas. I have been researching for the last hour and I tried just plain javascript, but for some reason the canvas is not changing. This same code works for an iframe on a different page.
<canvas id="canvas" height="400" width="400"></canvas>
<script type="text/javascript">
$(document).ready(function () {
$("#canvas").attr('width', 800);
});
</script>
What I want to do is set the width equal to the window size minus 100 px, but right now I have it set as 800 so I can try to figure out why this is not working.
$("#canvas").attr('width', 800);?using $("#canvas").attr('width,800);instead of$("canvas").width(800). (This second command did resize the canvas, it just also maintained the original aspect ratio, so the resized canvas was 800 by 800).