The function that moves the cursor of an input element to the end in jQuery is .focus(). But sometimes, this won’t work even if you replace it with [0].click(). It’ll maybe work on input fields properly, but won’t properly at all in text areas. Mostly it won’t work, if you are calling the .focus() function inside an event listener function.
To solve this you can use 2 other methods if the first one don’t work. It’s pretty simple and I don’t know why it works. I found this solution on a Stack Overflow question and the one who answered doesn’t know why it works. Here is a list of the events that happens when an element is clicked :
... [READ MORE]