how to add printing feature to webpage javascript code example Example: print button code in php <button onClick="window.print()">Print</button>