Browsed by
Category: Javascript

Print page and specific section with JavaScript

Print page and specific section with JavaScript

Whole Page :   If we want to print complete to print . we can do it with JavaScript Print() mehtod.   <!DOCTYPE html> <html> <body> <p>Click the button to print the current page.</p> <button onclick=”myFunction()”>Print this page</button> <script> function myFunction() { window.print(); } </script> </body> </html>     Print Specific portion : If we want to print specific portion then we need to implement some more works . Here’s are that .   <html xmlns=”http://www.w3.org/1999/xhtml”> <head>     <title></title>     <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js”></script>     <script type=”text/javascript”>         $(“#btnPrint”).live(“click”, function ()…

Read More Read More