0

Suppose I have a simple <input type="text">, is it possible to add a Javascript listener to listen for when a user mouseover a typed text inside that input? If so, could I also know exactly which letter (or position in the string) they are currently moused over?

I am willing to use JS frameworks like jQuery to achieve this.

hobbes3
  • 28,078
  • 24
  • 87
  • 116
  • 1
    http://stackoverflow.com/questions/3743266/retrieving-character-position-in-case-of-a-mouse-over-event – Lord Midi Apr 04 '14 at 17:53

1 Answers1

1

Nope. Letters in an input are not HTML elements. You need HTML elements to have event handlers.

The only way to accomplish this is to hide the input box and have a fake one over top and wrap each individual letter in a SPAN as you type. That way each letter is within an actual HTML element.

Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176