There's a lot of solution around here
to place cursor at the end of text for input
or textbox
tag.
Use JavaScript to place cursor at end of text in text input element
jQuery Textbox Cursor to end of Text?
jQuery Set Cursor Position in Text Area
Currently, I use div
tag with contenteditable = "true"
instead of using input
or textbox
tag.
Unfortunately, even I replace val
to text
to make the code work, none of them works as intended.
Any thought? Thanks.