FF下这个方法吗?execCommand("Bold",false,null);    
FF下是不支持innerText的

解决方案 »

  1.   

    fckeditor下了,但是功能太多,没分析出头绪啊. 只是要做个简单的编辑器,所以不想用那么复杂的.
      

  2.   

    参考了别人的代码,设置黑体可以用了
    editor.contentWindow.focus();
    var Range;
    if(ie)
    {
    Range=editor.contentWindow.document.selection.createRange();
    Range.execCommand("bold",false,false);
    }
    else
    {
    //Range=editor.contentWindow.document.getSelection ? editor.contentWindow. document.getSelection() : window.getSelection();
    editor.contentWindow.document.execCommand("bold",false,false);

    ================================================================================
    但是显示HTML到TEXTAREA的还是不能用...
         window.document.getElementById('preview').text =window.frames['edit'].document.body.innerHTML;
    不知道为什么window.document.getElementById('preview').text赋值会没有效果..