Scroll to top

How to create print button function?

<html>
<body>

<p>Click the this button for printing</p>

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

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

</body>
</html>

                  or



<button onClick=”window.print()”>Print this page</button>




Leave a Reply

Your email address will not be published. Required fields are marked *