Printing is a very common feature and you can use JavaScript to print a webpage. For example you could put a Javascript to a button so when someone click on the print button a print dialog box popup given the user a chance to print out what they see on a web page.

Use Window.print function to print the page. Here's how:

/* This style basically say that print everything else except the button */
@media print
{
   input.hideFromPrinting
   {
      display: none;
   }
}

<input onclick="window.print()" type="button" value="Print">

print

You can use window.print on other object as well and not just the button input object.

 

 
* iOS Development * OS X * Product Review