javascript print option

by MANIMUTHUPANDI 2014-03-12 12:20:40

Print an Image | div using javascript


Some times you may need to print a html content.
It may be a div content or img.

Javascript has a built in function called print().
princt() can be called using the appropriate object namely html content.
See the below code


function printQuotes(IMGsource) {
var doc=window.open();
doc.document.write("<img src='"+IMGsource+"' />");
doc.print();
doc.close();
}

Tagged in:

651
like
0
dislike
0
mail
flag

You must LOGIN to add comments