I’m currently reading into Javascript’s createRange() function and related constructs and was thinking about what applications this had.
Then I found out about this application “https://www.warroomlaw.com/demo“, it uses a highlighting ability based on mouse clicks and then saves the highlighted data. Very useful for studying or research.
However it’s HTML code is based on tables, I was wondering is it actually using createRange() or related functions or is it using something totally different?
That site is using indeed using ranges (and the browser Selection API) to do the highlighting. You could study the code in the demo page HTML from line 822 onwards to work out what it’s doing, although it’s not a great example because the JavaScript highlight code is very tightly coupled to the particular HTML of the page.