How is the carriage emulated in Etherpad?

How does the carriage emulated in the Etherpad blink? (See the live version on ietherpad.com) The way I do this is to create a div and place it absolutely where the caret should be. Then display and delete it at regular intervals. However, they seem to do it differently.

The text of the line is in

<div id="magicdomid2" class="">...</div>

I don't see anything that changes around a div. How it's done?

+5
source share
1 answer

It is not emulated. In modern browsers, Etherpad creates iframecontaining a document with the tag:

<body contenteditable="true">

Which tells the browser to allow editing of the contained HTML document. Carat is one of the effects of including this attribute.

+3
source

All Articles