Home > Web Front-end > JS Tutorial > body text

Lainiao introduces the window.print() method_javascript skills

WBOY
Release: 2016-05-16 15:21:24
Original
1369 people have browsed it

Definition and usage of print() method:

This method can generate a print settings interface, which is the same as the interface generated by right-clicking the window and then clicking the print option.

Grammar structure:

window.print()

Browser support:

1.IE browser supports this attribute.
2.Firefox browser supports this attribute.
3. Opera browser supports this attribute.
4.Chrome browser supports this attribute.

Code example:

<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>window.print()函数</title>
<script type="text/javascript">
window.print();
</script>
</head>
<body>
</body>
</html>
Copy after login

Execution of the above code can generate a print settings interface, which can print the current page.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!