In the following link
<a href=\"#\" onclick=javascript:print(\"\") style=\"color:blue;\">Print</a>"
<script>
function print()
{
//How to print the contents of another page
}
Printing Simplified Web Pages With Chrome's Inbuilt SettingsWhen you're on the page you want to print, press “Ctrl+P” which will bring up the Print interface.
To print the content of div in JavaScript, first store the content of div in a JavaScript variable and then the print button is clicked. The contents of the HTML div element to be extracted.
If you already have an external page( letterprint.php
), put that page in a hidden iframe and print the content of iframe by using onclick attribute in a button.
<iframe src="letterprint.php" style="display:none;" name="frame"></iframe>
<input type="button" onclick="frames['frame'].print()" value="printletter">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With