Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active January 22, 2018 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/7f91ecc827963c90226f8afcefd6b1aa to your computer and use it in GitHub Desktop.
Save parzibyte/7f91ecc827963c90226f8afcefd6b1aa to your computer and use it in GitHub Desktop.
function imprimirElemento(elemento){
var ventana = window.open('', 'PRINT', 'height=400,width=600');
ventana.document.write('<html><head><title>' + document.title + '</title>');
ventana.document.write('</head><body >');
ventana.document.write(elemento.innerHTML);
ventana.document.write('</body></html>');
ventana.document.close();
ventana.focus();
ventana.print();
ventana.close();
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment