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 運算次方pow() 函数

PHP 運算次方pow() ...

使用pow() 函数返回 x 的 y 次方。 例如: BMI = 體重(公斤)除以身高(公尺)的平方...

PHP無法保存SESSION的問題

PHP無法保存SESSION...

一天,客戶反應系統後台無法登入。 而這問題是發生在客戶電腦更換了IP位置。 而我這邊也只是開放新的I...

使用curl執行POST請求

使用curl執行POST請求...

curl命令是一個利用URL規則在命令行下工作的文件傳輸工具。 支持文件的上傳和下載。 這邊範例使用...

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