So I know you can get the position of the cursor in a textarea by using element.selectionStart and element.selectionEnd.
Is there a way to do something similar with <code>
?
(I'm trying to color text written by the user. As it seems, you can only change a whole textarea's color, not certain parts. I'm using <code contenteditable="true">
to try and fix that, but it seems to remove the possibility of reading the cursors position)