<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Window print() Method</title>
</head>

<body>

<p>Click the button to print the current page.</p>

<button onclick="myFunction()">Print this page</button>

<script>
function myFunction() {
    window.print();
}
</script>

</body>
</html>