htmlhyperlinkhref

HTML link with href that refers to text?


This is a simple yes or no question (probably no), googling didn't seem to give me a straight answer. Say you have a link that is

<a href="www.stackoverflow.com">www.stackoverflow.com</a>

Is it possible to make something like

<a href=self.text>www.stackoverflow.com</a>

without using anything else (obviously, no scripts)? Is there any kind of shortcut?


Solution

  • No, you need to have both the href attribute and a value between the a tags. Without using any scripts, it's not possible to refer to its own contents.