Home > Article > Web Front-end > Method example of javascript printing html content function_javascript skills
My Printed Content |
All content
<script> </p> <p>var global_Html = ""; </p> <p>function printme() {</p> <p> global_Html = document.body.innerHTML; </p> <p> document.body.innerHTML = document.getElementById('divPrint').innerHTML; </p> window.print();<p> </p> window.setTimeout(function () {<p> </p> document.body.innerHTML = global_Html; <p> </p>}, 1500); <p> </p>}<p> </p></script>