I want to print the page on button click without opening a new tab.
I have a following lines of code that does the job for me.
function PrintDiv() {
You need @media print in you css. Just add this at your bottom ofyour CSS file,
@media print
@media print { #print {display: none;} }