Answer by nwillo for How to get the tag of selection?
You'll have to do a few things to achieve the type of functionality you desire:When you insert an H1 tag, add an identifier to it. Store this identifier along with the selected range values. Also, use...
View ArticleAnswer by jiwopene for How to get the tag of selection?
You can get tag where the selection starts/ends using getSelection().anchorNode and getSelection().focusNode.
View ArticleHow to get the tag of selection?
I created a function that wraps the selected text in the h1 tag, and also deletes the tags when it is called again. The function also deletes tags and creates again if you select an area larger than...
View Article
More Pages to Explore .....