onbeforeprint Event in JavaScript
onbeforeprint Event in JavaScript
The onbeforeprint event fires when a page is about to be printed. It happens before the dialogue box appears. It is used in combination with the onafterprint event.
Syntax:-
Its syntax is:- < element onbeforeprint="my_script" > OR object.onbeforeprint= function(){my_script} OR object.addEventListener("beforeprint", my_script)