print() method is used to open print dialog and print a current whole document or part of a document.
Some browser will block while the print dialog window is open.
This is used to apply specified css property while print the document.
Print by id value
We can print the part of document by using like below.