Show print dialog - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window print

Description

Show print dialog

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    function printpage() {//  w w w. ja v  a 2  s.  com
        window.print();
    }

      </script> 
   </head> 
   <body> 
      <a href="#" onclick="printpage()" data-role="button" data-theme="j">Print</a> 
      <a href="#" onclick="window.print()" data-role="button" data-theme="j">Print 2</a>  
   </body>
</html>

Related Tutorials