Show the print dialog in Javascript

Description

window.print() prompts the user to print the page. The print dialog is displayed asynchronously, returning control to the script immediately.

Example


<!DOCTYPE HTML> 
<html> 
    <body> 
        <script> 
            window.print(); <!-- w w  w . j ava 2  s .  c o m-->

        </script> 
    </body> 
</html>

Click to view the demo





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window