Event to detect when the text in an <input> is scrolled?

There is no specific event for this that will work across browsers. Firefox does fire a scroll event when the text "scrolls" by changing the insertion point, but Chrome and likely other browsers don't.

Here is a list of events that could change the insertion point.

  • input
  • keydown
  • keyup
  • focus
  • blur
  • click
  • change
  • paste
  • cut
  • scroll
  • wheel
  • dragover

Binding an event listener to all of these should be enough to respond to the insertion point changing. I believe the list above is complete, but if I have missed any, let me know!


Have you tried the Caret Plugin?

You can get the position of the caret with:

pos = $(textarea).caret()

and catch when it changes again. If the latter is different than the first then you know the user has moved inside the input.