I am using a jquery print plugin that has the capability to print out particular elements from the page.
If I call $('.main-container').print(); it will print out all elements within the main container.
However, there are many elements within the ‘main-container’ that I would not like to include in the element that is passed on to the print() function.
My question is, is there an a way to combine 3-4 elements into one and store that element in a variable so then I can pass this new element to the print() function leaving out all the elements I wish to not print?
Something like:
var $printThis = $('header').html();
$printThis += $('.middle-column').html();
$printThis += $('.footer').html();
$printThis.print();
Use CSS @media print and hide the nodes you don’t want to show.