Can we make print button without JavaScript?

JavascriptWeb DevelopmentFront End Technology

Yes, we can easily make a print button as well as add an image to it.

Example

You can try to run the following code to make a print button as image i.e. whenever a user clicks on the image, the print options are visible −

Live Demo

<!DOCTYPE html>
<html>
   <body>
      <a href="javascript:window.print()"><img src="https://www.tutorialspoint.com/computer_fundamentals/images/inkjet_printer.jpg" height="50" alt="print the page"></a>
      <p>Click above to print the page.<p>
   </body>
</html>
raja
Published on 03-Feb-2018 15:30:31
Advertisements