2012-03-16 96 views
0

我創建了一個div,並將它的contenteditable設置爲true來創建豐富的textarea。 現在我想聽ininput event.but在ie中,沒有這樣的事件。此外,我不能使用onpropertychange因爲textNode in ie不能附加事件。 做我必須使用的onkeydown,onpaste?(我不希望)ie detect innerHtml change

+0

可能dupe http://stackoverflow.com/questions/1391278/contenteditable-change-events – Manishearth 2012-03-16 15:00:32

+0

不完全一樣,我想這個事件在內容發生變化時觸發,就像firefox中的輸入事件 – 2012-03-16 15:12:22

+0

使用onfocus?或onchange? – 2012-03-16 15:13:04

回答

-1
name: <INPUT 
     NAME="realname" 
     onFocus = "window.status='Enter your name'" 
     onBlur = "window.status=window.defaultStatus" 
     ><BR> 
email: <INPUT 
     NAME="email" 
     onFocus = "window.status='Enter your email address'" 
     onBlur = "window.status=window.defaultStatus" 
     > 

,運行腳本的一個例子,當用戶點擊文本輸入。這也適用於文本區域。

+0

他正在談論一個「豐富的textarea」,基本上'

....
' – Manishearth 2012-03-16 15:39:20

+0

@Manishearth - 謝謝你的閱讀,也許應該更清楚地閱讀。 – 2012-03-16 15:40:43