1
我正在爲我的項目(MVC 4應用程序)使用Kendo UI編輯器。如何獲取按鈕點擊kendo編輯器文本的文本
在按鈕單擊事件中,我需要在用戶輸入文本並單擊預覽按鈕時在另一個div中顯示編輯器文本。
我該怎麼做?
我正在爲我的項目(MVC 4應用程序)使用Kendo UI編輯器。如何獲取按鈕點擊kendo編輯器文本的文本
在按鈕單擊事件中,我需要在用戶輸入文本並單擊預覽按鈕時在另一個div中顯示編輯器文本。
我該怎麼做?
試試這個:
function getClick(e) {
try { //the name of your editor
var editor = $("#editor").data("kendoEditor");
var editorContent = editor.value();
alert(editorContent);
//Do Your stuff here
}
catch (e) { }
}
然後用一個按鈕
<button class="k-button" id="btnPreviewContent" onclick="getClick()">PreviewEditor Content</button>
打電話,當我嘗試這個我只得到了標記的文本。有沒有辦法獲得所有的html標籤? –