首页 > 解决方案 > 如何在同一页面上初始化多个 wysihtml5 编辑器?

问题描述

当我用类名初始化 bootstrap-wysihtml5 时,它只会初始化第一个,其余的保持正常的文本区域

有什么办法可以处理

<script>
      $(document).ready(function() {
      $('.vid_description').wysihtml5();
    });
</script>

标签: javascriptbootstrap-wysiwygbootstrap-wysihtml5

解决方案


我猜,方法 wysihtml5() 只对第一个元素调用。

遍历所有元素并分别调用每个元素的初始化方法:

$('.vid_description').each(function() {
    $(this).wysihtml5();
});

推荐阅读