0

I create a div and set it's contenteditable to true to create a rich textarea. now I want to listen the oninput event, but in IE, there is no such event. Also, I can't use onpropertychange because textNode in IE can't attach events. Do I have to use onkeydown,onpaste? (I hope not)

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Guan Yuxin
  • 410
  • 6
  • 12
  • Possible dupe http://stackoverflow.com/questions/1391278/contenteditable-change-events – Manishearth Mar 16 '12 at 15:00
  • Not quite the same,I want this event fire when the content has change,like input event in firefox – Guan Yuxin Mar 16 '12 at 15:12
  • Note: `oninput` works in WebKit, so you might want to use it for Chrome/Safari at the very least, although feature detection might be a bit of a problem. – Andy E Mar 16 '12 at 15:27

1 Answers1

-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" 
      >

as an example of running scripts when a user clicks in a text-input. This will work with a text area as well.

Philip Bevan
  • 347
  • 1
  • 12