我在所有浏览器(包括IE)中都尝试了所有工作,但在firefox
中没有
$("#"+selector).attr("contentEditable", "true");//worked but now not
//document.getElementById(selector).setAttribute('contentEditable',true);
//frames[selector].document.designMode = 'On';
//document.getElementById(selector).contentDocument.designMode = "on";
//frames[selector].document.body.setAttribute("contentEditable","true");
//document.getElementById(selector).contentDocument.designMode = "on";//worked
$('#'+selector).contents().prop('designMode','on');
//$(this).contentDocument.designMode = "on";