'onBeforePrint' Example : onBeforePrint « Event onMethod « JavaScript DHTML






'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