tinymce富文本编辑器的使用
1.加载文本编辑器js
2.html中定义<textarea class="form-control" id="content"></textarea>
3.js中:
var initTinymce = function(){
tinymce.init({
selector: '#content',
plugins: [
"textcolor code"
],
menubar: false,
toolbar: [
"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | code",
"forecolor backcolor fontsizeselect",
],
height: 200,
fontsize_formats: "12px 14px 16px 18px 24px 32px 48px",
});
form.find('#content').val(relContent.val());
};
initTinymce();
初始化tinymce
4.通过tinyeditor.getContent()拿到里面的内容
1.加载文本编辑器js
2.html中定义<textarea class="form-control" id="content"></textarea>
3.js中:
var initTinymce = function(){
tinymce.init({
selector: '#content',
plugins: [
"textcolor code"
],
menubar: false,
toolbar: [
"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | code",
"forecolor backcolor fontsizeselect",
],
height: 200,
fontsize_formats: "12px 14px 16px 18px 24px 32px 48px",
});
form.find('#content').val(relContent.val());
};
initTinymce();
初始化tinymce
4.通过tinyeditor.getContent()拿到里面的内容