Back to all resources
printing

Print Page Button

By Digipop
This code snippet is a jQuery event handler that triggers the print dialog of the browser when an HTML element with the ID "print" is clicked. It uses the jQuery $() function to select the element with the ID "print". The .click() method is then called on this selected element, which sets up a click event listener. Inside the function passed to .click(), window.print() is called, which opens the browser's print dialog allowing the user to print the current page.