【发布时间】:2015-02-25 20:40:23
【问题描述】:
我正在使用 Bootstrap-wysihtml5 jquery 插件 (https://github.com/jhollingworth/bootstrap-wysihtml5/) 将文本区域转换为所见即所得。我希望能够通过单击 2 个按钮来激活和停用编辑器,到目前为止我可以显示编辑器,请你告诉我如何停用编辑器并只留下 textarea 及其值。我的代码如下:-
HTML
<textarea name="textarea" id="textarea" cols="45" rows="5"></textarea>
<input type="button" id="button1" value="Show Editor">
<input type="button" id="button2" value="Hide Editor">
脚本
$("#button1").click(function(){
$('textarea').wysihtml5();
});
$("#button2").click(function(){
// this is where i'm stuck
});
谢谢
【问题讨论】:
标签: wysihtml5