Open window in JavaScript with HTML inserted

Issue

How would I open a new window in JavaScript and insert HTML data instead of just linking to an HTML file?

Solution

You can use window.open to open a new window/tab(according to browser setting) in javascript.

By using document.write you can write HTML content to the opened window.

Answered By – rahul

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published