I would like to be able to dynamically insert a div at the end of a string in a text input.
For example, if I have a text input…
MyInput: <input type="text" name="myInput" value="" />
…and in their browser someone types…
MyInput: Here is some sample input
I would like to generate the div immediately after the word input.
Does anyone know how to get the absolute pixel coordinates of the tail end of a string in a text input?
Thanks!
I don’t like answers like this, but:
And you want it to work cross-browser and cross-platform, right? IE, Chrome, Firefox, Safari; Windows, Linux, Mac… I have a very strong suspicion we’re not there yet. When you get into input boxes, you get into natively-rendered controls (on IE, for instance), which takes you down the rabbit hole of installed fonts and accessibility enhancements and…
Unless the use case really is overwhelming, or someone points to the feature I don’t know about (and will be very happy to learn of), I’d recommend approaching this UI from a different angle.