JavaScript implementation click button to print _ javascript tips-js tutorial

Source: Internet
Author: User
Many websites have this function. When browsing to the bottom, there will be a print button. Click the print button to complete the print function. The function is very good and user-friendly, this article describes how to print the code by clicking a button in JavaScript. For more information, see this function on many websites. A print button is displayed at the bottom of the page, click the print button to complete the printing function. The function is very good, user-friendly, and the code is very simple.

Foot home

That is, you only need to call the window. print () function to print the current page.

But the above is not perfect, because many content on some web pages do not need to be printed. The following describes how to print the specified content on the page.

The Code is as follows:

 
 Print content

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.