How to print the specific area of the page in jquery?
Snippet Code
Rate this page :
[ 1 votes]
Printarea is a simple jquery plugin which allows your user to visit a specified area on your webpage. The json settings is used to open the printed area through hidden iframe or through a popup dialog box. Sample code to print a specific area using jqury is given below.
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src='http://www.jqueryscript.net/demo/Print-Specified-Area-Of-A-Page-PrintArea/demo/jquery.PrintArea.js'></script>
<script>
$(document).ready(function(){
$("#print_button").click(function(){
var options = {mode:"popup",popHt: 500, popWd: 400, popX: 500, popY: 600,popTitle:"This is PrintArea Demo",popClose: false};
$("div.PrintArea").printArea( options );
});
});
</script>
<div class="PrintArea">
<div>This is the printed content for this page.</div>
</div></br></br>
<input type='button' value='Print' id='print_button'>