資料載入中

胡言亂語

使用javascript獲取ckeditor textarea的textarea值

一般來說,若我想使用 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值。

以上紀錄
 

  • javascript 獲取 textarea 值的方法
  • 使用 ckeditor 獲取編輯器內容
  • 編輯器ID名為 blog_content
  • 獲取ckeditor textarea的值
  • 如何使用javascript操作textarea
https://innstory.com/story-使用javascript獲取ckeditortextarea的textarea值-1823

上一篇
 Linux下查看版本號指令

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

發表留言

作者簡介

離不開電腦的宅男


推薦閱讀

作者其他相關類別故事

解決iphone 不能使用colorbox 滑動的方式

解決iphone 不能使用c…

Mark Chang 8 年又 85 天 2.8K

以上紀錄

.htaccess設定網站預設首頁次序

.htaccess設定網站預…

Mark Chang 5 年又 68 天 1.8K

一般php空間預設設定是index.php為首頁。 所以如果網站用index.php做首頁,就不需...

PHP使用array_product函數求得陣列中的乘積

PHP使用array_pro…

Mark Chang 3 年又 341 天 1.4K

arrayproduct()是PHP中的一個內建函數,可以返回陣列中所有元素的乘積。 例如 若想要...