Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move cursor to end of contenteditable [duplicate]

Possible Duplicate:
How to move cursor to end of contenteditable entity

How do I move the cursor to the end of a contenteditable div? I only need a solution that works in webkit, I dont care about ie or ff here. The shorter, the better. :-)

like image 675
Leticia Meyer Avatar asked Aug 09 '11 02:08

Leticia Meyer


1 Answers

The first answer you looked at will work for a textarea, but not for a contenteditable element.

This solution is for moving the caret to the end of a contenteditable element.

How to move cursor to end of contenteditable entity

like image 133
Jason Gennaro Avatar answered Nov 16 '22 22:11

Jason Gennaro