I have an html page with a link like this:
<a href="javascript:window.print()">Print QR code</a>
When a user clicks it, it does what you think it will.. prints the whole page.. sadly, it does not print the QR code at all. How do I specify what I want to print? Like, lets say I want to print a specific image on the page?
I have an html page with a link like this:
<a href="javascript:window.print()">Print QR code</a>
When a user clicks it, it does what you think it will.. prints the whole page.. sadly, it does not print the QR code at all. How do I specify what I want to print? Like, lets say I want to print a specific image on the page?
Share Improve this question edited Jun 24, 2012 at 8:08 gdoron 150k59 gold badges302 silver badges371 bronze badges asked Jun 24, 2012 at 7:59 AturSamsAturSams 7,96218 gold badges67 silver badges106 bronze badges2 Answers
Reset to default 2I know this is an old post, but just wanted to share you this solution that worked very well without using jquery.
http://www.codescratcher./javascript/print-image-using-javascript/#ment-762
I found this plugin that does the trick:
http://projects.erikzaadi./jQueryPlugins/jQuery.printElement/
$('img#some_id').printElement();