<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>WangEditor(但页面多个文本编辑器)</title>
<style type="text/css">
.text {
border:1px solid #ccc;
height:200px;
}
.toolbar {
background-color:#f1f1f1;
border:1px solid #ccc;
}
</style>
</head>
<body>
<div id="div1" class="toolbar"></div>
<div style="padding:20px;border:1px solid #ccc"></div>
<div id="div2" class="text"><p>第一个demo(菜单和编辑器分开)</p></div>
<div id="div3"><p>第二个demo常规</p></div>
<script src="wangEditor.min.js"></script>
<script>
var E = window.wangEditor;
var editor1 = new E('#div1', '#div2')
editor1.create();
var editor2 = new E("#div3");
editor2.create();
editor1.$textElem.attr('contenteditable', false);
editor2.$textElem.attr('contenteditable', false);
//禁用编辑器
editor1.$textElem.attr('contenteditable', true);
editor2.$textElem.attr('contenteditable', true);
//启用编辑器
</script>
</body>
</html>