Minifycode 2020-01-16 Viewed 1.3K times Javascript

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