I have tried to use the above method to make the canvas on my webpage responsive to resize, but I am unable to implement it although I have used this before. When I am making the canvas element, I use
var canvas = document.createElement('canvas'); //works
canvas.style.resize = "both";
In addition, I change the position to absolute, style.top, style.left, style.width and style.height if that makes a difference. Am I doing something wrong? If so, how do I allow users to make the canvas resizeabe?