Div 'canvasesdiv' element contains three HTML5 canvases.
<div style="position: relative; width: 400px; height: 300px;" id="canvasesdiv">
<canvas width="400" height="300px" style="z-index: 1; position: absolute; left: 0px; top: 0px;" id="layer1" />
<canvas width="400" height="300px" style="z-index: 2; position: absolute; left: 0px; top: 0px;" id="layer2"/>
<canvas width="400" height="300px" style="z-index: 3; position: absolute; left: 0px; top: 0px;" id="layer3"/>
</div>
How can I save an image combining all canvases present inside the div 'canvasesdiv' at client side using JavaScript?