I need to create an application which is similar to google docs. I have seen that google docs doesn't use any textarea but regular divs to create pages. But what I don't know is how they manage to get a text cursor. Is it an image blinking? cause I didn't see any image when i tried to see the webpage code with chrome developer tools. How do they do it?
Google Docs uses unique editing method. There is no text ares with contentEditable on, but everything is rendered using DOM. It listens for keystrokes and manipulates DIVs.
Cursor is just absolute positioned DIV which is programatically hidden or shown. Search for class named "kix-cursor-caret".
Editor is codenamed Kix and you can see it's source codes here: https://github.com/benjamn/kix-standalone
来源:https://stackoverflow.com/questions/7877225/google-docs-textcursor