kindeditor判斷輸入為空
來源:易賢網(wǎng) 閱讀:1277 次 日期:2016-06-24 08:47:50
溫馨提示:易賢網(wǎng)小編為您整理了“kindeditor判斷輸入為空”,方便廣大網(wǎng)友查閱!

最近用了一個開源編輯器kindeditor,國產(chǎn)的還是十分不錯的,在判斷編輯器輸入值的時候,找了一會兒,現(xiàn)在將代碼拿出來

主要是kindeditor判斷輸入是否為空,獲取kindeditor的html內(nèi)容 獲取kindeditor的text文本內(nèi)容。

其實kindeditor延續(xù)了jquery的獲取方式,主要是用kindeditor創(chuàng)建的對象來操作,而不是jquery對象

創(chuàng)建editor對象

var editor = kindeditor.create('textarea[name=content1]...

創(chuàng)建的對象就可以拿到對應的html和text值了,這樣就可以判斷kindeditor輸入是否為空

editor.html();是獲取編輯器內(nèi)容的html代碼

editor.text();是獲取編輯器內(nèi)容,是去除了html的。

判斷kindeditor是否為空就簡單了if(editor.html()==)則就能判斷了~

更多信息請查看腳本欄目
易賢網(wǎng)手機網(wǎng)站地址:kindeditor判斷輸入為空
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權(quán)所有:易賢網(wǎng)