Your question is very vague, based on what I understand you need something like this -
1. Open the modal form
2. read its html
3. Copy the html
4. Show it in say a text area element...
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<a href="#">Click here to open dialog
<svg id="OpenDialog" width="20px" height="20px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M16 2H7.979C6.88 2 6 2.88 6 3.98V12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 10H8V4h8v8zM4 10H2v6c0 1.1.9 2 2 2h6v-2H4v-6z"/></svg>
</a>
<br>
</br>
<div class="data_copy">
<p>html data to copy</p>
<p>test</p>
<input type="text" />
<button type="button">testing </button>
</div>
<script>
$(document).ready(function () {
$("#OpenDialog").click(function () {
var w = window.open("", "popupWindow", "width=600, height=400, scrollbars=yes");
var $w = $(w.document.body);
$w.html("<textarea></textarea>");
});
});
</script>