Normal printing is to use window.print(); to print the entire page directly, but if you need to print part of the content defined in the web page, you can use the following method:
1. Add JavaScript to the code header of the page :
JavaScript code
2. Add and flags.
That is, append it to the html corresponding to the text that the user needs to print and save. At the same time, if a thief program is used to obtain remote data and needs to be printed, the data can be placed in the definition tag.
3. The intercepted content part has been completed. Now add a "print" link:
Print