<head> <script language="JavaScript"> function function1() { window.print(); } </script> </head> <body onbeforeprint="alert('This page is about to be printed')"> <p>Some body Content to print.</p> <input type="button" value="Print" onclick="function1()"> </body> </html>