Print a web page using javascript

The print() method is used to print the contents of the current window.

w=window.open();
w.document.write(document.getElementsByClassName('test')[0].innerH‌​TML);
w.print();
w.close();

Related topics:

Please Share