Save hidden DIV as canvas image
问题 I used the following code to save the visible as image. html2canvas(document.querySelector('.specific'), { onrendered: function(canvas) { theCanvas = canvas; Canvas2Image.saveAsPNG(canvas); } }); Is there any way that I can able to save the hidden 回答1: There are some solutions out there, like for example display property toggle, or render inside hidden element. Solution 1 Quickly toggle visibility property const el = document.querySelector('.specific'); el.style.display = "block"; // or any