Window print()Method

Window 对象参考手册Window Object

Definition and Usage

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

Syntax

window.print()


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the print() method.


Examples

Examples

Print the current page:

function printpage(){
    window.print();
}

Try it Yourself »


Window 对象参考手册Window Object Other Extensions