From e0c66e96954e64b21ada50d035ad916ef181f004 Mon Sep 17 00:00:00 2001 From: pacozaa Date: Tue, 14 Jun 2016 11:20:16 +0700 Subject: [PATCH 1/2] Edit set text dynamically Edit set text dynamically according to this issue https://github.com/Waxolunist/bootstrap3-wysihtml5-bower/issues/45# --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9287130..3206151 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,10 @@ This is the new style from version 0.3 on and will be supported on all browsers. The javascript will keep the same. For example it is easier to change the content dynamically on runtime. ```javascript -$('.textarea').html('Some text dynamically set.'); +$(".text_area").wysihtml5(); +var editorObj = $(".text_area").data('wysihtml5'); +var editor = editorObj.editor; +editor.setValue('Some text dynamically set.'); ``` #### Textarea From b806b9b67da1d3d0cebee11de7752793c359c370 Mon Sep 17 00:00:00 2001 From: pacozaa Date: Tue, 14 Jun 2016 11:22:17 +0700 Subject: [PATCH 2/2] Edit set text dynamically with same id Edit set text dynamically with same id --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3206151..818a0e3 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,8 @@ This is the new style from version 0.3 on and will be supported on all browsers. The javascript will keep the same. For example it is easier to change the content dynamically on runtime. ```javascript -$(".text_area").wysihtml5(); -var editorObj = $(".text_area").data('wysihtml5'); +$("#some-textarea").wysihtml5(); +var editorObj = $("#some-textarea").data('wysihtml5'); var editor = editorObj.editor; editor.setValue('Some text dynamically set.'); ```