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

PHP如何設定HTTP安全標頭?

PHP如何設定HTTP安全標...

PHP該如何將以下安全標頭添加到網站? XFrameOptions  防止點擊劫持攻擊 XXSSPr...

PDO bindParam 和 bindValue 差別在哪裡?

PDO bindParam ...

首先 bindParam 是綁定變數、bindValue  是綁定值。 以下範例: bindPara...

修改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