Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Created July 5, 2013 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhishekGhosh/5936940 to your computer and use it in GitHub Desktop.
Save AbhishekGhosh/5936940 to your computer and use it in GitHub Desktop.
Print form
<!-- Part 1 : Add this on header before the head closes with </head> tag -->
<script type="text/javascript">
<!--
//-->
</script>
<!-- Part 2 : Add where you want to render the print button. Value field determines the label of the button -->
<form>
<input type="button" value="Print" onclick="window.print()" />
</form>
</body>
<!-- Alternatively, You can use the combined form too -->
<form>
<input type="button" value="Print" onclick="window.print()" />
</form>
</body>
<script type="text/javascript">
<!--
//-->
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment