Usage and Definition
The print() method prints the contents of the current web page.
<!DOCTYPE html>
<html>
<body>
<p>Click the button to print the current page.</p>
<button onclick="yourFunction()">Print</button>
<script>
function yourFunction() {
window.print();
}
</script>
</body>
</html>
Window print() Method In Javascript
minify code