Open preview window printing by javascript

0

I would like to know how to open this preview preview window of IE by javascript, I need a button that opens this window, without having to go through it through the settings.

    
asked by anonymous 13.11.2017 / 14:35

1 answer

0

Use the print method of the window object.

window.print() 

If you want to bind to the click of a button it would look like this:

<input type="button" name="imprimir" value="Imprimir" onclick="window.print();">
    
13.11.2017 / 14:46