Resize the HTML5 canvas dynamically

Is it possible to resize the HTML5 canvas dynamically. Looking for answers, Thanks

Yes, HTML5 canvas can be resized dynamically using JavaScript by setting its width and height properties.