EN
JavaScript - open print dialog
0 points
In this article, we would like to show you how to open print dialog using JavaScript.
Quick solution:
xxxxxxxxxx
1
window.print();
In this example, we use window.print()
to open the print dialog on the body
element load so we can print the content of the current window.
xxxxxxxxxx
1
<html>
2
<body onload="window.print()">
3
<img src="https://dirask.com/static/bucket/1631898942509-VMYrnXyYZv--image.png" />
4
</body>
5
</html>