i was trying to print dynamic div html element using printElement() function but when i got problem...my code as follows
$("#btnPrint").click(function () {
if (ImgPath != '') {
sHtml = "<div id='dvPrint'><table>";
sHtml += "<tr><td>" + "<img src='" + ImgPath + "' border='0'/>" + "</td></tr>";
sHtml += "<tr><td>" + $('#lblTxt').html() + "</td></tr>";
sHtml += "</table></div>";
alert($('#dvPrint').html());
$("#element").printElement('#dvPrint');
}
else {
alert("Image not found for print");
}
return false;
});
when i just alert alert($('#dvPrint').html());
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