jQuery PrintThis Plugin Example to Print Specific Parts of HTML5 DOM in Webpage Using Javascript Full Project For Beginners

 

 

 

index.html

 

 

<html>
    <head>
        <title>PRINT PAGE</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/printThis/1.15.0/printThis.min.js"></script>
    </head>
    <body>      
            <form>
            Nama : <input type="text" id="nama"> 
            Kelas : <input type="text">
            </form>
        <button>PRINT</button>
        <script>
            $(document).ready(function(){
                $("button").click(function(){
                    $("#nama").printThis({
                        debug: false,             
                        importCSS: true,            
                        importStyle: false,         
                        printContainer: true,      
                        loadCSS: "", 
                        pageTitle: "UTOPIAN PRINT",             
                        removeInline: false,    
                        printDelay: 1,      
                        header: null,        
                        footer: null,            
                        base: false ,              
                        formValues: true,          
                        canvas: false,              
                        doctypeString: "",      
                        removeScripts: false,       
                        copyTagClasses: false  
                    });
                });             
            });
        </script>
    </body>
</html>

Leave a Reply