我有以下代码。但问题是当我尝试复制文本时,格式受到干扰。请帮我解决这个问题。例如,相同的间距行不会被复制,相反,普通格式没有间距,下一行等。
代码:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
</script>
<script> function copyToClipboard(element) { var $temp = $(""); $("body").append($temp); $temp.val($(element).text()).select(); document.execCommand("copy"); $temp.remove(); alert("Text Copied"); } </script>
<textarea id="p1" cols="60" rows="13">
Hello Team,
Thank you for your Email.
You can follow below steps to fix the issue. You can also try below link for reference.
https://www.w3schools.com/css/default.asp
Note: Please use “Reply to All” while replying to this mail, so that my team can respond in my absence
Best Regards,
Kumar
Technology Services, Enterprise Group
Please use this portal to view all your support case details
Website : http://www.google.co.in
</textarea>
<textarea id="p2" cols="60" rows="13">Hi,
Welcome to Tech world
please read all documents carefully
Regards,
XXXXXXX
Mobie:XXXX
</textarea>
<textarea id="p3" cols="60" rows="13">Hi,
Welcome to Tech world
please read all documents carefully
Regards,
XXXXXXX
Mobie:XXXX
</textarea>
Firt box 第二个盒子 第三盒