<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>index</title>
</head>
<body>
<div style="text-align:center; margin-top: 30px">
    <div id="printArea">
        <div>......文本打印区域......</div>
        <div>......文本打印区域......</div>
        <div>......文本打印区域......</div>
        <div>......文本打印区域......</div>
        <div>......文本打印区域......</div>
    </div>
    <br>
    <br>
    <input id="btnPrint" type="button" value="打印文本区域"></input>
    <input id="btnPrintFull" type="button" value="全屏打印"></input>
</div>
</body>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="https://blog-static.cnblogs.com/files/ningjiabing/jquery.PrintArea.min.js"></script>
<script>
    $("#btnPrint").click(function(){
        $("#printArea").printArea();
    });

    $("#btnPrintFull").click(function(){
        $("body").printArea();
    });

</script>
</html>

 

相关文章:

  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
猜你喜欢
  • 2021-06-28
  • 2021-09-05
  • 2022-03-10
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案