create URL with anchor to text selection
问题 I would like to create a URL pointing to a web service I write, http://mycoolthing.com , together with an #-anchor that refers to a text selection on that page. Is is possible in HTML/JS to create an anchor that refers to a Selection or a RangeObject? 回答1: chromium based browsers now support Scroll To Text Fragment https://chromestatus.com/feature/4733392803332096#:~:text=This%20feature%20allows%20a%20user,and%20scrolls%20it%20into%20view. 回答2: As I mentioned in a comment, here is an option