Quantcast
Channel: How to get the tag of selection? - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Image may be NSFW.
Clik here to view.

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 Article



Answer 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 Article

How 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
Browsing latest articles
Browse All 3 View Live




Latest Images