Multiple cursor textarea | SoloLearn: Learn to code for FREE!

+9

Multiple cursor textarea

Is it possible to have multiple separate cursors (caret) in text area by pressing ctrl+alt keys like in code editors? how can I do that using javascript? P.S: I googled before

10/13/2020 9:06:54 PM

CoffeeByte

3 Answers

New Answer

+5

Sounds very hard. I think the best option would be to create a custom textarea by your own. Disable the standard caret (I guess this can be done with CSS alone) and create your own carets with CSS and Javascript. Looks like multiple selection is available on Firefox only so you are likely going to need to re-invent that too: https://developer.mozilla.org/en-US/docs/Web/API/Selection/addRange

+7

Kevin ★ thanks, I've been thinking in a custom HTML element extended from textarea

+4

there is probably a library for html code editor, I've seen visual studio code and repl.it used a very similar editor that have support for multiple caret.