0
我创建了一个div,并将它的contenteditable设置为true来创建丰富的textarea。 现在我想听ininput event.but在ie中,没有这样的事件。此外,我不能使用onpropertychange因为textNode in ie不能附加事件。 做我必须使用的onkeydown,onpaste?(我不希望)ie detect innerHtml change
我创建了一个div,并将它的contenteditable设置为true来创建丰富的textarea。 现在我想听ininput event.but在ie中,没有这样的事件。此外,我不能使用onpropertychange因为textNode in ie不能附加事件。 做我必须使用的onkeydown,onpaste?(我不希望)ie detect innerHtml change
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"
>
,运行脚本的一个例子,当用户点击文本输入。这也适用于文本区域。
@Manishearth - 谢谢你的阅读,也许应该更清楚地阅读。 – 2012-03-16 15:40:43
可能dupe http://stackoverflow.com/questions/1391278/contenteditable-change-events – Manishearth 2012-03-16 15:00:32
不完全一样,我想这个事件在内容发生变化时触发,就像firefox中的输入事件 – 2012-03-16 15:12:22
使用onfocus?或onchange? – 2012-03-16 15:13:04