
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How can I pop-up a print dialog box using JavaScript?
To pop-up a print dialog box using JavaScript, use the print() method. With the dialog box, you can easily set the printing options like which printer to select for printing.
This is the dialog box −
Example
You can try to run the following code to learn how to print a page −
<!DOCTYPE html> <html> <body> <button onclick="display()">Click to Print</button> <script> function display() { window.print(); } </script> </body> </html>
- Related Articles
- How I can replace a JavaScript alert pop up with a fancy alert box?
- How do I automatically download files from a pop up dialog using selenium-python?
- How to show prompt dialog box using JavaScript?
- How can I create a dialog box in Java with Yes No and cancel buttons?
- Creating a prompt dialog box using Tkinter?
- How I can change the style of alert box using JavaScript?
- Raise a "File Download" Dialog Box using Perl
- How to automate menu box/pop up of right click in Python Selenium?
- Can selenium handle Windows based pop up?
- How to create a Custom Dialog box on iOS App using Swift?
- How to remove fake JavaScript pop-up messages and warnings?
- How to create a Dialog Box without a title in Android using Kotlin?
- How do I make a pop-up in Tkinter when a button is clicked?
- How to handle "Plugin blocked" pop up using Selenium Python?
- How do we define a dialog box in HTML?

Advertisements