Introduction of ES0en. print of method

  • 2020-11-25 07:06:51
  • OfStack

Definition and usage of print() method:

This method can generate 1 print setting interface, which is similar to the interface generated by right-clicking the window and then clicking the print option.

Grammatical structure:

window.print()

Browser support:

1.IE browser supports this property.
2.Firefox browser supports this property.
3.Opera browser supports this property.
4.chrome browser supports this property.

Code example:


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

The above code execution can produce 1 print setup interface, which can print the current page.


Related articles: