Skip to content
Advertisement

Remove page numbers on pages once user completes there printing html + Javascript

this solution worked for me to add page numbers to my HTML once the user clicks ctrl + P.

how can I have the script remove the page numbers once the users finished the print job? (not sure how to remove a function with javascript)

I used this solution to implement the JavaScript code: https://stackoverflow.com/a/64884005

JavaScript
JavaScript
JavaScript

Advertisement

Answer

Hi and welcome to stack overflow.

In a nutshell, give each div you add a unique class. After you have printed the pages, run a script to select all the divs with that class and delete them.

after your line of code

JavaScript

add this

JavaScript

Then add a function

JavaScript

and call it

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement