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

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

Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 12288 bytes) in

Fatal error: Allowed memory size of 50331648 bytes exhausted (tried to allocate 12288 bytes) in

今天在客戶的網站系統上發現了一個問題。 在上傳檔案時發生了一個錯誤: Fatal...

文件上傳過程中使用白名單、黑名單、或者MIME做認證

文件上傳過程中使用白名單、黑名單、或者MIME做認證

pexelsphotolock 是不是被資安的問題搞得很煩? 我想,在建置系統的過程中...

改變input placeholder 字體顏色

改變input placeholder 字體顏色

colorphoto 通常我們會使用 placeholder 來作為欄位提醒文字~ 通...

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