Javascript examples for DOM:Element removeChild
print html generated by functions to printer?
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// w ww . ja v a 2s .c om var someHtml = '<a href="">a</a>'; var i = document.createElement('iframe'); i.onload = function() { i.contentDocument.body.innerHTML = someHtml; i.contentWindow.print(); setTimeout(function() { document.body.removeChild(i); }, 0); }; document.body.appendChild(i); } </script> </head> <body> </body> </html>