解决方案 »

  1.   

    这个你就得去自己找插件了,或者你自己花时间去写一个。你应该要的跟CSDN这个回复框差不多的,挺多这东西的。
    去搜搜吧
      

  2.   

    就是搜不到啊  这个是不一样的  这个回复框是textaera无法显示图片的  要和百度贴吧的差不多  但是百度贴吧的无法改变文字的颜色和大小
      

  3.   

    IE用document.selection对象,标准浏览器用window.getSelection,自己慢慢研究这2个东东demo给个你参考
    <style>
    #editor{border:solid 1px #000;height:150px;width:300px;}
    </style>
    <div id="editor" contenteditable="true">测试内容</div>
    <input type="button" value="红色" onclick="Color('red')" />
    <script>
        function Color(c) {
            var e = document.getElementById('editor');
            e.focus();
            if (window.getSelection) {
                var s = window.getSelection(), r = s.getRangeAt(0);
                if (r.toString() == '') { alert('请选择内容!'); return }
                var sp = document.createElement('span');
                sp.style.color = c;
                r.surroundContents(sp);
                s.collapse(sp, 1);
            }
            else if (document.selection) {
                var r = document.selection.createRange();
                r.pasteHTML('<span style="color:' + c + '">' + r.text + '</span>');
            }
        }
    </script>