Javascript language

adplus-dvertising
How to use print() Method in JavaScript
Previous Home Next

The print() method prints the contents of the current window.

Syntax:
window.print()

Example:

<html>
<body>
<script language="JavaScript">
    function print_win() 
    {
        window.print();
    }
</script>
<input type="button" value="Print" onclick="print_win();">
</body>
</html>
Output
Previous Home Next