How to print a dynamic div html element using jquery
<p>i was trying to print dynamic div html element using printElement() function but when i got problem...my code as follows</p>

<pre><code>$("#btnPrint").click(function () {
                if (ImgPath != '') {
                    sHtml = "&lt;div id='dvPrint'&gt;&lt;table&gt;";
                    sHtml += "&lt;tr&gt;&lt;td&gt;" + "&lt;img src='" + ImgPath + "' border='0'/&gt;" + "&lt;/td&gt;&lt;/tr&gt;";
                    sHtml += "&lt;tr&gt;&lt;td&gt;" + $('#lblTxt').html() + "&lt;/td&gt;&lt;/tr&gt;";
                    sHtml += "&lt;/table&gt;&lt;/div&gt;";
                    alert($('#dvPrint').html());
                       $("#element").printElement('#dvPrint');
                }
                else {
                    alert("Image not found for print");
                }
                return false;
            });
</code></pre>

<p>when i just alert <code>alert($('#dvPrint').html());</code> it show nothing. then how printElement() can work. i can append my dynamic div into body....i just need to generate div and print the content inside it by jquery.......i need help. thanks</p>
