'onBeforePrint' Example : onBeforePrint « Event Handlers Reference « JavaScript Reference

'onBeforePrint' Example

    
<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>

    
      
      








Related examples in the same category

1.'onBeforePrint' Syntax and Note
2.'onBeforePrint' Properties
3.'onBeforePrint' is applied to