우리의 응용 프로그램에서는 HTML (텍스트 및 형식)을 클립 보드에 복사하는 데 다음 논리를 사용합니다. document.execCommand ("copy")는 Internet Explorer 11에서 더 이상 작동하지 않습니다.
function copy(element_id)
{
var aux = document.createElement("div");
aux.setAttribute("contentEditable", true);
aux.innerHTML = document.getElementById(element_id).innerHTML;
aux.setAttribute("onfocus", "document.execCommand('selectAll',false,null)");
document.body.appendChild(aux);
aux.focus();
document.execCommand("copy");
document.body.removeChild(aux);
console.log("COPY");
}
<p id="demo"><b>Bold text</b> and <u>underlined text</u>.</p>
<button onclick="copy('demo')">Copy To Clipboard Keeping Format</button>
최신 Internet Explorer 버전 11.125.16299.0 (Updateversion : 11.0.49 - KB4052978)에서는 HTML이 더 이상 클립 보드에 복사되지 않습니다.
이 아래에 대한 보안 설정이 있습니다 :
Options -> Security -> Edit level ... -> Scripting -> Allow access to clipboard
내가 "활성화"를 "요청"에서 값을 변경했습니다. 이 효과가 없습니다.
아무도 왜 변경되었는지, 다른 해결책 또는 해결 방법을 알고 있습니까? 고맙습니다.