I'm trying to write a post with form fill tutorial. There are a lot of sources, but source pages doesn't provide anchors on pages.
So my question is , how to make links to concrete paragraphs of text on html pages?
Is it possible at all?
Are there any JavaScript tricks in the url to achieve that?
edit:
I need to make link to particular paragraph on external source. For example to paragraph beginning with words "The Navy traces its origins to the" on this Wikipedia's page
Simply go to that answer you want to link to and Right-Click on the area near it. From the right-click menu choose the Inspect Element option. It'll show you HTML code, look for an ID tag or Value option. Once you find it, copy it on your clipboard.
As of 2020, there is a draft by WICG for Text Fragments, and now you can link to text on a page as if you were searching for it by adding the following to the hash
#:~:text=<Text To Link to>
Working example on Chrome Version 81.0.4044.138
:
Click on this link Should reload the page and highlight the link's text
You can only link to named anchors or elements with ids. If the target page has neither you are out of luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With