I am currently using the following code to create a string and copy it. However, when I paste it as output, the line break is not being applied.
function copyToClipboardShipto() {
var $temp = $("<input>");
$("body").append($temp);
var str1 = "@(Model.firstName)";
var str2 = " ";
var str3 = "@(Model.lastName)";
var str4 = "\n";
var str5 = "@(Model.shiptoes[0].address.address1)";
var str6 = ",";
var str7 = "@(Model.shiptoes[0].address.address2)";
var str8 = "\n";
var str9 = "@(Model.shiptoes[0].address.city)";
var str10 = ",";
var str11 = "@(Model.shiptoes[0].address.state)";
var str12 = "\n";
var str13 = "@(Model.shiptoes[0].address.zip)";
var str = str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + str10 + str11 + str12 + str13;
$temp.val(str).select();
document.execCommand("copy");
$temp.remove();
}
}
Any assistance would be greatly appreciated! firstname lastname223 E JACKSON AVE,city,state zip