Serialize DOM Range

is there a standard / easy way to serialize the DOM Range (and IE equivalent) with a java script.

The motivation is to keep the current selection of the document along with its HTML code.


I was thinking of using XPath for this, but before I start reinventing the wheel, something might already be working, and I just couldn't find it (a jQuery-based solution would be best).

+4
source share
2 answers

I think I got a link to the answer below: Rangy, cross-browser JavaScript range and select library

+2
source

Several times I would find something like this useful, and I don't know anything that currently exists. XPath seems like a logical choice for me.

0
source

Source: https://habr.com/ru/post/1301067/


All Articles