JS

HOW TO TAKE SCREENSHOT WITH JAVASCRIPT

<h1>TEST</h1> <textarea>Dummy Text</textarea> <input type="button" value="Capture" onclick="capture()"/>

DUMMY HTML

01

function capture () {    html2canvas(document.body)   .then((canvas) => {     let a = document.createElement("a");     a.download = "ss.png";     a.href = canvas.toDataURL();     a.click();   }); }

JS TAKE SCREENSHOT

02