Search w3schools.com:

SHARE THIS PAGE

Window print() Method

Window Object Reference Window Object

Definition and Usage

The print() method prints the contents of the current window.

Syntax

window.print()


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The print() method is supported in all major browsers.


Example

Example

Print the current page:

<html>
<head>
<script>
function printpage()
  {
  window.print()
  }
</script>
</head>
<body>

<input type="button" value="Print this page" onclick="printpage()">

</body>
</html>

Try it yourself »


Window Object Reference Window Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]