How do I find out the style of text by caret position in a contenteditable div?
I am making a simple WYSIWYG editor and there was a need to display the pressed button "B" (bold), which makes the selected text bold if the caret is in the tag limit (tags are not visible, because contenteditable). I don't want to reinvent the wheel, what if there is already an easier way to understand which tags contain the text by the position of the carriage?
To place the code, please use CodePen or similar tool. Thanks you!