I have a JavaScript function that constructs a URL using form inputs and allows users to preview it in a DIV named "preview" before opening the URL in a new window via a submit button.
While everything is working as expected, I am looking for a way to modify the window.open function so that the webpage is opened within a DIV instead of a new window.
Here is my current code for the submit button to open the URL in a new window:
<input type="submit" onClick="window.open(document.getElementById('preview').innerHTML);" value="Open Launch URL in New Window" tabindex="10"/>
...where "preview" represents the ID of the DIV where the URL is displayed for preview.
I have tried implementing multiple onClick events but haven't been successful in achieving the desired result.