Javascript

Take Screenshots With Javascript (Simple Examples)

Welcome to a tutorial and examples on how to take screenshots with Javascript. So you have a project that needs to do screenshots? An easy way to capture screenshots in Javascript is to use the html2canvas library: html2canvas(document.body).then(canvas => { let a = document.createElement(“a”); a.download = “ss.png”; a.href = canvas.toDataURL(“image/png”); a.click(); }); That’s all for

Take Screenshots With Javascript (Simple Examples) Read More »

Simple Textarea With Remaining Characters Counter (Free Download)

Welcome to a tutorial on how to create a text area with a remaining character counter in Javascript. Limiting the number of characters in a text field is as easy as setting the maxlength, but how do we add a “countdown” to it? <textarea id=”demoA” maxlength=”160″></textarea> <div id=”demoB”>160</div> <script> var a = document.getElementById(“demoA”), b =

Simple Textarea With Remaining Characters Counter (Free Download) Read More »