1function copyToClipboard(element) {
2 var $temp = $("<textarea>");
3 var brRegex = /<br\s*[\/]?>/gi;
4 $("body").append($temp);
5 $temp.val($(element).html().replace(brRegex, "\r\n")).select();
6 document.execCommand("copy");
7 $temp.remove();
8}
9
10$( "#FailCopy" ).click(function() {
11 alert("Well done! div #error-details has been copy to your clipboard, now paste it in the notepad or email!");
12});