Original answer

In standard Markdown, place an anchor <a name="abcd"></a> where you want to link to and refer to it on the same page by link text.

(This uses name= and not id=, for reasons explained in this answer.)

Remote references can use link text of course.

This works like a dream, provided you have control over the source and target texts. The anchor can even appear in a heading, thus:

A Heading in this SO entry!

produces: A Heading in this SO entry!

and we can even link to it so:

and we can even link to it so:

(On SO, the link doesn’t work because the anchor is stripped.)

More information: