Print page with JS
Rodrigo Cordeiro
Posted on June 30, 2020
Hey Devs, I'm here today to show you something amazing. How to print the page with JS.
Let's suppose you're have a form to fulfill a document and you need to print it. For this we're going to use a simple js function.
For this example, I'm going to use a button calling the function.
<button onclick="imprimir">Imprimir</button>
Then, add the following script
function imprimir(){
window.print();
}
💖 💪 🙅 🚩
Rodrigo Cordeiro
Posted on June 30, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascript Navigating the World of JavaScript: A Mechanical Engineer's Perspective on Learning and Challenges
November 25, 2024