Print The Contents Of A Div

<script type="text/javascript" src="" > </script> 
<script type="text/javascript">

    function PrintElem(elem)

    function Popup(data) 
        var mywindow ='', 'my div', 'height=400,width=600');
        mywindow.document.write('<html><head><title>my div</title>');
        /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
        mywindow.document.write('</head><body >');


        return true;


<div id="mydiv">
    This will be printed. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque a quam at nibh adipiscing interdum. Nulla vitae accumsan ante. 

    This will not be printed.

<div id="anotherdiv">
    Nor will this.

<input type="button" value="Print Div" onclick="PrintElem('#mydiv')" />

By Rz Rasel Posted in jQuery

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s