The JavaScript print function window.print() will print the current web page when executed. You can call this function directly using onclick event as follows:

<head>
<script type="text/javascript">
<!-- //-->
</script>
</head>
 <body>
 <form> <input type="button" value="Print" onclick="window.print()" />
 </form>
 </body>