事实证明,这是一个已知的IE 11序列化问题。此处示例:
var root = document.getElementById('editor');
var kid1 = document.getElementById('kid1');
var kid2 = document.getElementById('kid2');
root.appendChild(kid1);
root.appendChild(kid2);
alert(root.innerHTML);
<div id="editor" contenteditable="true" data-ckeditor="true"></div>
<div>
<input name="fieldControlId2" id="kid1" type="radio" checked="checked" value="1">
<input name="fieldControlId2" id="kid2" type="radio" value="2">
</div>
解决方案很简单,在操作节点之前,请运行IE11的fixup:
if (isIe11()) {
$(kid).find('input[checked="checked"]').each(function() {
$(this)[0].setAttribute("checked");
});
}