2012-03-16 91 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