I want to print the content of a div using jQuery. This question is already asked in SO, but I can\'t find the correct (working) answer.
This is is my HTML:
Print only selected element on codepen
HTML:
Print 1
Click Me To Print
Print 2
Click Me To Print
JQuery:
$('.js-print-link').on('click', function() {
var printBlock = $(this).parents('.print').siblings('.print');
printBlock.hide();
window.print();
printBlock.show();
});