Loading...

使用javascript獲取ckeditor textarea的textarea值

Temperature: 0 °C

Mark ChangMark Chang
author_tools

一般來說,若我想使用 javascript 來得到 textarea 的值。

可以使用以下方式:

首先,假設我的編輯器ID名為 blog_content

var inputwrite = document.getElementById("blog_content");
alert(inputwrite.value)

但若是使用 ckeditor textarea 編輯器,則必須使用以下方式:
var inputwrite = CKEDITOR.instances.blog_content.getData();
alert(inputwrite.value)

這樣,應該就可以解決獲取ckeditor textarea的textarea值。

以上紀錄
 

https://innstory.com/story-使用javascript獲取ckeditor_textarea的textarea值-1823
javascript

Prev
 Linux下查看版本號指令

Next
Ckeditor使用onkeyup事件綁定卻無動作解決方式 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

解決svchost.exe消耗記憶體問題

解決svchost.exe消...

pexelsphotowin55 根據微軟中文知識庫編號5的文件說明:「SVCHOST.EXE是從動...

使用PHP取得指定月份最後一天的日期

使用PHP取得指定月份最後一...

使用PHP要如何抓某個月份的最後一天 例如抓本月份的話可以使用下列範例: date(&#;Ymt&#...

修改php.ini更改允許上傳檔案的大小

修改php.ini更改允許上...

使用vi或vim開啟php.ini #vim /etc/php/apache/php.ini 找到以...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format