Add these lines after newWin.document.write(divToPrint.innerHTML)
newWin.document.close();
newWin.focus();
newWin.print();
newWin.close();
Then print function will work in all browser…
More Related Contents:
- Find out how many tabs are opened in IE [closed]
- ‘innerText’ works in IE, but not in Firefox
- Print the contents of a DIV
- How to fix Array indexOf() in JavaScript for Internet Explorer browsers
- ‘console’ is undefined error for Internet Explorer
- Detect IE version (prior to v9) in JavaScript
- javascript document.getElementsByClassName compatibility with IE
- MSIE and addEventListener Problem in Javascript?
- Fixing JavaScript Array functions in Internet Explorer (indexOf, forEach, etc.) [closed]
- Input placeholders for Internet Explorer
- Is there an Internet Explorer approved substitute for selectionStart and selectionEnd?
- How to support promises in Internet Explorer 11?
- How can Print Preview be called from Javascript?
- Save base64 string as PDF at client side with JavaScript
- jQuery keypress() event not firing?
- Syntax error in IE using ES6 arrow functions
- Open a new javascript window(.open) along with its CSS styling
- Could not complete the operation due to error 80020101. IE [duplicate]
- Saving text in a local file in Internet Explorer 10
- img onload doesn’t work well in IE7
- Responding to the onmousemove event outside of the browser window in IE
- control the working directory for ?
- Javascript Invalid Date Error in Internet Explorer
- IE Bug (window === top) === false
- IE support for DOM importNode
- setTimeout Internet Explorer
- Emulate clicking a link with Javascript that works with IE
- The best placeholder polyfil script for ie7, ie8 and ie9 [closed]
- Copy Current Webpage Into a New Window
- doPostback failing in IE 11+ Windows 8.1