jquery打印指定的div

<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="java.util.*"%>
<html>
	<head>
		<title></title>
	</head>
	<script type="text/javascript" src="jquery-1.4.3.js"></script>
	<script type="text/javascript" src="jquery.PrintArea.js"></script>
	<body>
		<input id="btnPrint" type="button" value="打印"/>
		<div id="myPrintArea">
			====打印区域====
		</div>
	</body>
	<script type="text/javascript">
		$(function(){
			//打印
			$("#btnPrint").bind("click",function(event){
				$("#myPrintArea").printArea();
			});
		});
	</script>
</html>

 

 

 

Link: http://phl.iteye.com/blog/825110

 

 

 

 

你可能感兴趣的:(jquery)