Window.print()

Baseline 2023

Newly available

Since June 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

摘要

打開列印視窗來列印當前的文件。

語法

window.print()

注釋

Starting with Chrome V46.0 this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.

規範

Specification
HTML Standard
# printing

參見