Window print() Method

Definition and Usage

print() The method prints the content of the current window.

print() The method opens the print dialog and allows the user to set preferred print options.

Call print() The behavior caused by the method is like the user clicking the print button of the browser. Usually, this will generate a dialog box that allows the user to cancel or customize the print request.

Instance

Print the current page:

window.print();

Try It Yourself

Syntax

window.print()

Parameters

None.

Technical Details

Return Value

:

None.

Browser Support

All Browsers Support print():

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support