This article provides a simple way to print specific div content or full page content using JavaScript. I personally believe this technique should be present in many more web pages for the convenience of site visitors who … The print () method prints the contents of the current window. Prerequisites. Projecting Content into Components with ng-content. it printed only a small part of the content. How to insert spaces/tabs in text using HTML/CSS? Print Div Content Using JavaScript Introduction. This plugin is as basic as it comes. First time it works but after that not a single button on the ribbon is working. Note: You can also use window.onbeforeprint and window.onafterprint to assign handlers for these events, but using … Now the most important part, Creating a Javascript function to print a particular div element. The soloution doesn't work on mobile devices with activated Javascript. Opens the Print Dialog to print the current document. The contents of the HTML div element to be extracted. Hide or show elements in HTML using display property.