I want to print some HTML markup with jQuery. There is a print button. When the print button is clicked, the click event creates some markup. I want to print those markup on a printer. How is it possible without any plugin?
The button
<a class="print-button" href="#" title="Print"></a>
The jquery:
$('.print-button').click(function (){
var markup = '<html><head><title>TODO supply a title</title>... ...';
// now print the markup
})
I just put a bit of the markup; because its too long.
Important: The markup contains also css in it. Some content has background image