The standard way to do that, which Wikipedia employs, is with HTML code called an ID attribute.
The way it generally works is that they wrap text in an HTML element called a span. It looks like this:
<span>Some text here</span>.
They make it so you can link to it by giving the span an ID attribute, like this: