UEditor编辑器增加placeholder提⽰HTML:
<div>
<!-- 加载编辑器的容器 -->
<div id="editor"  class="fls" ></div>
</div>
<input id="editortext"  type="hidden" />
JS:
//编辑器ID:editor    储存⽂本值ID:editortext
UE.Editor.prototype.placeholder = function (justPlainText) {
var _editor = this;
_editor.addListener("focus", function () {
var localHtml = _PlainTxt();
if ($.trim(localHtml) === $.trim(justPlainText)) {
_editor.setContent("");
}
});
_editor.addListener("blur", function () {
var localHtml = _Content();
if (!localHtml) {
_editor.setContent('<p >' + justPlainText + '</p>');//提⽰语字体灰⾊
//_editor.setContent(justPlainText);//提⽰语字体⿊⾊
}
});
_ady(function () {
_editor.fireEvent("blur");
});
};
//失去焦点,⽂本为空时,添加
if ($("#储存⽂本值ID").val() == "") {
//placeholder内容(只能是⽂本内容)
editor.placeholder("请输⼊。。。。");
多文本编辑器editor什么意思}
});
//实例化编辑器example
var editor = UE.getEditor('编辑器ID');
if ($("#储存⽂本值ID ").val() == "") {
//placeholder内容(只能是⽂本内容)
editor.placeholder("请输⼊。。。。");
}