This will capture edits in the contenteditable txt div 'PreviewHeader'.The answer is to put three text divs on your page to hold the two text items that you want to concatenate and the third one to hold the concatenated version. These cannot be hidden but you can make the text very small and the same color as the background to make them invisible to the user as follows:
<%--Below are hidden fields that help with the copy functions. In addition to these "hidden" divs there is the PreviewHeader header div which is very visible on the page.--%>
<asp:Panel ID="Panel1" runat="server" Visible="True">
<div class="row">
<div id="HiddenURLdiv" contenteditable="false" style="z-index: 1; font-size: 2px; color: white; text-align: left; border: 0px solid">
<span>
<asp:Literal ID="hiddenurlliteral" runat="server"></asp:Literal></span>
</div>
</div>
<div class="row">
<div id="HiddenWUandLink" contenteditable="false" style="z-index: 1; font-size: 2px; color: white; text-align: left; border: 0px solid"></div>
</div>
</asp:Panel>
<%--Above are hidden fields that help with the copy functions--%>
Then you can use the following function to create and copy the concatenated text.
<%--Below script allows combining the text content of two divs into another third div and copying the content of the third div. --%>
<script>
function copywithlink() {
var target = document.getElementById('PreviewHeader');
var range, select;
var target1 = document.getElementById('HiddenWUandLink');
document.getElementById('HiddenWUandLink').innerHTML = ""
if (document.createRange) {
range = document.createRange();
range.selectNode(target)
document.getElementById('HiddenWUandLink').append(range.cloneContents(target.childNodes).textContent);
document.getElementById('HiddenWUandLink').append(document.getElementById('HiddenURLdiv').innerText);
var texttoedit = document.getElementById('HiddenWUandLink').innerText
texttoedit = texttoedit.replace(/(\r\n|\n|\r)/gm, "");
texttedit = texttoedit.trim()
document.getElementById('HiddenWUandLink').innerText = texttoedit
range = document.createRange();
range.selectNode(target1);
select = window.getSelection();
select.removeAllRanges();
select.addRange(range);
document.execCommand('copy');
select.removeAllRanges();
} else {
range = document.body.createTextRange();
range.moveToElementText(target);
range.select();
document.execCommand('copy');
<%--Overall the above script is working good but it is adding a lf before the copied text. This does not matter for my application.--%>
}